Class LevelRangeFilter
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
decide
(LoggingEvent event) Return the decision of this filter.boolean
Get the value of theAcceptOnMatch
option.Get the value of theLevelMax
option.Get the value of theLevelMin
option.void
setAcceptOnMatch
(boolean acceptOnMatch) Set theAcceptOnMatch
option.void
setLevelMax
(Level levelMax) Set theLevelMax
option.void
setLevelMin
(Level levelMin) Set theLevelMin
option.Methods inherited from class org.apache.log4j.spi.Filter
activateOptions, getNext, setNext
-
Field Details
-
Constructor Details
-
LevelRangeFilter
public LevelRangeFilter()
-
-
Method Details
-
decide
Return the decision of this filter. -
getAcceptOnMatch
public boolean getAcceptOnMatch()Get the value of theAcceptOnMatch
option. -
getLevelMax
Get the value of theLevelMax
option. -
getLevelMin
Get the value of theLevelMin
option. -
setAcceptOnMatch
public void setAcceptOnMatch(boolean acceptOnMatch) Set theAcceptOnMatch
option. -
setLevelMax
Set theLevelMax
option. -
setLevelMin
Set theLevelMin
option.
-