public abstract class AbstractFilter extends Object implements Filter, LifeCycle
Filter.Result
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOGGER
Allow subclasses access to the status logger without creating another instance.
|
protected Filter.Result |
onMatch
The onMatch Result.
|
protected Filter.Result |
onMismatch
The onMismatch Result.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractFilter()
The default constructor.
|
protected |
AbstractFilter(Filter.Result onMatch,
Filter.Result onMismatch)
Constructor that allows the onMatch and onMismatch actions to be set.
|
Modifier and Type | Method and Description |
---|---|
Filter.Result |
filter(LogEvent event)
Context Filter method.
|
Filter.Result |
filter(Logger logger,
Level level,
Marker marker,
Message msg,
Throwable t)
Appender Filter method.
|
Filter.Result |
filter(Logger logger,
Level level,
Marker marker,
Object msg,
Throwable t)
Appender Filter method.
|
Filter.Result |
filter(Logger logger,
Level level,
Marker marker,
String msg,
Object... params)
Appender Filter method.
|
Filter.Result |
getOnMatch()
Returns the Result to be returned when a match occurs.
|
Filter.Result |
getOnMismatch()
Returns the Result to be returned when a match does not occur.
|
boolean |
isStarted()
Determine if the the Filter has started.
|
void |
start()
Mark the Filter as started.
|
void |
stop()
Mark the Filter as stopped.
|
String |
toString() |
protected static final Logger LOGGER
protected final Filter.Result onMatch
protected final Filter.Result onMismatch
protected AbstractFilter()
protected AbstractFilter(Filter.Result onMatch, Filter.Result onMismatch)
onMatch
- The result to return when a match occurs.onMismatch
- The result to return when a match dos not occur.public boolean isStarted()
public final Filter.Result getOnMismatch()
getOnMismatch
in interface Filter
public final Filter.Result getOnMatch()
getOnMatch
in interface Filter
public Filter.Result filter(Logger logger, Level level, Marker marker, String msg, Object... params)
public Filter.Result filter(Logger logger, Level level, Marker marker, Object msg, Throwable t)
public Filter.Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t)
public Filter.Result filter(LogEvent event)
Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.