public class LevelRangeFilter extends Filter
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.
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
acceptOnMatch
Do we return ACCEPT when a match occurs.
|
(package private) Level |
levelMax |
(package private) Level |
levelMin |
Constructor and Description |
---|
LevelRangeFilter() |
Modifier and Type | Method and Description |
---|---|
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. |
void |
setAcceptOnMatch(boolean acceptOnMatch)
Set the
AcceptOnMatch option. |
void |
setLevelMax(Level levelMax)
Set the
LevelMax option. |
void |
setLevelMin(Level levelMin)
Set the
LevelMin option. |
activateOptions, getNext, setNext
boolean acceptOnMatch
false
, so that later filters get run by defaultpublic LevelRangeFilter()
public int decide(LoggingEvent event)
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.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses