|
Log4j 1.2beta3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.log4j.spi.Filter | +--org.apache.log4j.varia.PriorityMatchFilter
LevelMatchFilter
instead.
This is a very simple filter based on level matching.
The filter admits two options LevelToMatch and
AcceptOnMatch. If there is an exact match between the value
of the LevelToMatch option and the level of the LoggingEvent
, then the decide(org.apache.log4j.spi.LoggingEvent)
method returns Filter.ACCEPT
in case the AcceptOnMatch option value is set
to true
, if it is false
then Filter.DENY
is returned. If there is no match, Filter.NEUTRAL
is returned.
See configuration files test11.xml and test12.xml for an example of
seeting up a LevelMatchFilter
.
Field Summary | |
static String |
ACCEPT_ON_MATCH_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term. |
static String |
LEVEL_TO_MATCH_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term. |
Fields inherited from class org.apache.log4j.spi.Filter |
ACCEPT, DENY, NEUTRAL, next |
Constructor Summary | |
PriorityMatchFilter()
Deprecated. |
Method Summary | |
int |
decide(LoggingEvent event)
Deprecated. Return the decision of this filter. |
boolean |
getAcceptOnMatch()
Deprecated. |
String[] |
getOptionStrings()
Deprecated. We now use JavaBeans introspection to configure components. |
String |
getPriorityToMatch()
Deprecated. |
void |
setAcceptOnMatch(boolean acceptOnMatch)
Deprecated. |
void |
setPriorityToMatch(String level)
Deprecated. |
Methods inherited from class org.apache.log4j.spi.Filter |
activateOptions |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String LEVEL_TO_MATCH_OPTION
public static final String ACCEPT_ON_MATCH_OPTION
Constructor Detail |
public PriorityMatchFilter()
Method Detail |
public String[] getOptionStrings()
public void setPriorityToMatch(String level)
public String getPriorityToMatch()
public void setAcceptOnMatch(boolean acceptOnMatch)
public boolean getAcceptOnMatch()
public int decide(LoggingEvent event)
Filter.NEUTRAL
if the PriorityToMatch
option is not set. Otherwise, the returned decision is defined
according to the following table:
Did a priority match occur? | AcceptOnMatch setting | |
---|---|---|
TRUE | FALSE | |
TRUE | Filter.ACCEPT | Filter.DENY |
FALSE | Filter.DENY | Filter.ACCEPT |
decide
in class Filter
org.apache.log4j.spi.Filter
event
- The LoggingEvent to decide upon.decision
- The decision of the filter.
|
Log4j 1.2beta3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |