@Plugin(name="filters", category="Core", printObject=true) public final class CompositeFilter extends AbstractLifeCycle implements Iterable<Filter>, Filter
Filter.Result
LifeCycle.State
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
ELEMENT_TYPE
Modifier and Type | Method and Description |
---|---|
CompositeFilter |
addFilter(Filter filter) |
static CompositeFilter |
createFilters(Filter[] filters)
Creates a CompositeFilter.
|
Filter.Result |
filter(LogEvent event)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
org.apache.logging.log4j.message.Message msg,
Throwable t)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
Object msg,
Throwable t)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object... params)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1,
Object p2)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1,
Object p2,
Object p3)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7,
Object p8)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7,
Object p8,
Object p9)
Filter an event.
|
List<Filter> |
getFilters()
Deprecated.
|
Filter[] |
getFiltersArray() |
Filter.Result |
getOnMatch()
Returns the result that should be returned when the filter matches the event.
|
Filter.Result |
getOnMismatch()
Returns the result that should be returned when the filter does not match the event.
|
boolean |
isEmpty()
Returns whether this composite contains any filters.
|
Iterator<Filter> |
iterator() |
CompositeFilter |
removeFilter(Filter filter) |
int |
size() |
void |
start() |
boolean |
stop(long timeout,
TimeUnit timeUnit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current
thread is interrupted, whichever happens first.
|
String |
toString() |
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public CompositeFilter addFilter(Filter filter)
public CompositeFilter removeFilter(Filter filter)
@Deprecated public List<Filter> getFilters()
getFiltersArray()
public Filter[] getFiltersArray()
public boolean isEmpty()
public int size()
public void start()
start
in interface LifeCycle
start
in class AbstractLifeCycle
public boolean stop(long timeout, TimeUnit timeUnit)
LifeCycle2
stop
in interface LifeCycle2
stop
in class AbstractLifeCycle
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentpublic Filter.Result getOnMismatch()
getOnMismatch
in interface Filter
public Filter.Result getOnMatch()
getOnMatch
in interface Filter
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object... params)
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0)
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1)
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1, Object p2)
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1, Object p2, Object p3)
filter
in interface Filter
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- String text to filter on.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parameterspublic Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1, Object p2, Object p3, Object p4)
filter
in interface Filter
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- String text to filter on.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parameterspublic Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5)
filter
in interface Filter
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- String text to filter on.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parameterspublic Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6)
filter
in interface Filter
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- String text to filter on.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parameterspublic Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7)
filter
in interface Filter
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- String text to filter on.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parameterspublic Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8)
filter
in interface Filter
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- String text to filter on.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parametersp8
- the message parameterspublic Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9)
filter
in interface Filter
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- String text to filter on.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parametersp8
- the message parametersp9
- the message parameterspublic Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, Object msg, Throwable t)
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, org.apache.logging.log4j.message.Message msg, Throwable t)
public Filter.Result filter(LogEvent event)
@PluginFactory public static CompositeFilter createFilters(@PluginElement(value="Filters") Filter[] filters)
filters
- An array of Filters to call.Copyright © 1999-2021 The 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.