|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.filter.AbstractFilter
public abstract class AbstractFilter
Users should extend this class to implement filters. Filters can be either context wide or attached to an appender. A filter may choose to support being called only from the context or only from an appender in which case it will only implement the required method(s). The rest will default to return NEUTRAL.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.Filter |
---|
Filter.Result |
Field Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
protected |
AbstractFilter()
The default constructor. |
protected |
AbstractFilter(Filter.Result onMatch,
Filter.Result onMismatch)
Constructor that allows the onMatch and onMismatch actions to be set. |
Method Summary | |
---|---|
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Logger LOGGER
protected final Filter.Result onMatch
protected final Filter.Result onMismatch
Constructor Detail |
---|
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.Method Detail |
---|
public void start()
start
in interface LifeCycle
public boolean isStarted()
isStarted
in interface LifeCycle
public void stop()
stop
in interface LifeCycle
public final Filter.Result getOnMismatch()
getOnMismatch
in interface Filter
public final Filter.Result getOnMatch()
getOnMatch
in interface Filter
public String toString()
toString
in class Object
public Filter.Result filter(Logger logger, Level level, Marker marker, String msg, Object... params)
filter
in interface Filter
logger
- the Logger.level
- The logging Level.marker
- The Marker, if any.msg
- The message, if present.params
- An array of parameters or null.
public Filter.Result filter(Logger logger, Level level, Marker marker, Object msg, Throwable t)
filter
in interface Filter
logger
- the Logger.level
- The logging Level.marker
- The Marker, if any.msg
- The message, if present.t
- A throwable or null.
public Filter.Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t)
filter
in interface Filter
logger
- the Logger.level
- The logging Level.marker
- The Marker, if any.msg
- The message, if present.t
- A throwable or null.
public Filter.Result filter(LogEvent event)
filter
in interface Filter
event
- The LogEvent.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2013 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.