org.x4juli.filter
Class LevelMatchFilter
java.lang.Object
org.x4juli.global.components.AbstractComponent
org.x4juli.global.components.AbstractFilter
org.x4juli.filter.LevelMatchFilter
- All Implemented Interfaces:
- Component, ExtendedFilter, java.util.logging.Filter, OptionHandler
- public class LevelMatchFilter
- extends AbstractFilter
This is a very simple filter based on level matching.
Logging API as a whole was originally done for Apache log4j. Juli is a
port of main parts of that to complete the Java Logging
APIs. All credits for initial idea, design, implementation,
documentation belong to the log4j crew. This
file was originally published by Ceki Gülcü. Please use
exclusively the appropriate mailing lists for questions, remarks and
contribution.
- Since:
- 0.5
- Author:
- Boris Unckel
|
Field Summary |
(package private) boolean |
acceptOnMatch
Do we return ACCEPT when a match occurs. |
(package private) java.util.logging.Level |
levelToMatch
|
| Fields inherited from class org.x4juli.global.components.AbstractFilter |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
acceptOnMatch
boolean acceptOnMatch
- Do we return ACCEPT when a match occurs. Default is
true.
levelToMatch
java.util.logging.Level levelToMatch
LevelMatchFilter
public LevelMatchFilter()
decide
public int decide(ExtendedLogRecord record)
- Return the decision of this filter.
Returns
ExtendedFilter.DENY if the LevelToMatch option is
not set or if there is not match. Otherwise, if there is a match, then
the returned decision is ExtendedFilter.ACCEPT if the
AcceptOnMatch property is set to true. The
returned decision is ExtendedFilter.DENY if the AcceptOnMatch
property is set to false.
- Specified by:
decide in interface ExtendedFilter- Specified by:
decide in class AbstractFilter
- Parameters:
record - The LoggingEvent to decide upon.- Since:
- 0.5
- See Also:
AbstractFilter.decide(org.x4juli.global.spi.ExtendedLogRecord)
setLevelToMatch
public void setLevelToMatch(java.lang.String level)
- Parameters:
level - - Since:
- 0.5
getLevelToMatch
public java.lang.String getLevelToMatch()
- Returns:
- String representation of the level to match
- Since:
- 0.5
setAcceptOnMatch
public void setAcceptOnMatch(boolean acceptOnMatch)
- Parameters:
acceptOnMatch - - Since:
- 0.5
getAcceptOnMatch
public boolean getAcceptOnMatch()
- Returns:
- whether matches or not
- Since:
- 0.5
${license_html}