|
Log4j 1.2beta4 | |||||||||
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.LevelRangeFilter
This is a very simple filter based on level matching, which can be used to reject messages with priorities outside a certain range.
The filter admits three options LevelMin, LevelMax and AcceptOnMatch.
If the level of the LoggingEvent
is not between Min and Max
(inclusive), then Filter.DENY
is returned.
If the Logging event level is within the specified range, then if
AcceptOnMatch is true, Filter.ACCEPT
is returned, and if
AcceptOnMatch is false, Filter.NEUTRAL
is returned.
If LevelMin
w is not defined, then there is no
minimum acceptable level (ie a level is never rejected for
being too "low"/unimportant). If LevelMax
is not
defined, then there is no maximum acceptable level (ie a
level is never rejected for beeing too "high"/important).
Refer to the setThreshold
method
available to all
appenders extending AppenderSkeleton
for a more convenient way to
filter out events by level.
Field Summary | |
static String |
ACCEPT_ON_MATCH_OPTION
See class comments |
static String |
LEVEL_MAX_OPTION
See class comments |
static String |
LEVEL_MIN_OPTION
See class comments |
Fields inherited from class org.apache.log4j.spi.Filter |
ACCEPT, DENY, NEUTRAL, next |
Constructor Summary | |
LevelRangeFilter()
|
Method Summary | |
int |
decide(LoggingEvent event)
Return the decision of this filter. |
boolean |
getAcceptOnMatch()
Get the value of the AcceptOnMatch option. |
Level |
getLevelMax()
Get the value of the LevelMax option. |
Level |
getLevelMin()
Get the value of the LevelMin option. |
String[] |
getOptionStrings()
Deprecated. We now use JavaBeans introspection to configure components. |
void |
setAcceptOnMatch(boolean acceptOnMatch)
Set the AcceptOnMatch option. |
void |
setLevelMax(Level levelMax)
Set the LevelMax option. |
void |
setLevelMin(Level levelMin)
Set the LevelMin option. |
void |
setOption(String key,
String value)
Deprecated. We now use JavaBeans introspection to configure components. |
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_MIN_OPTION
public static final String LEVEL_MAX_OPTION
public static final String ACCEPT_ON_MATCH_OPTION
Constructor Detail |
public LevelRangeFilter()
Method Detail |
public int decide(LoggingEvent event)
decide
in class Filter
org.apache.log4j.spi.Filter
event
- The LoggingEvent to decide upon.decision
- The decision of the filter.public Level getLevelMax()
LevelMax
option.public Level getLevelMin()
LevelMin
option.public boolean getAcceptOnMatch()
AcceptOnMatch
option.public void setLevelMax(Level levelMax)
LevelMax
option.public void setLevelMin(Level levelMin)
LevelMin
option.public void setAcceptOnMatch(boolean acceptOnMatch)
AcceptOnMatch
option.public String[] getOptionStrings()
public void setOption(String key, String value)
|
Log4j 1.2beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |