@Plugin(name="filters", category="Core", printObject=true) public final class CompositeFilter extends AbstractLifeCycle implements Iterable<Filter>, Filter
Filter.ResultLifeCycle.StateDEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGERELEMENT_TYPE| Modifier and Type | Method and Description |
|---|---|
CompositeFilter |
addFilter(Filter filter) |
static CompositeFilter |
createFilters(Filter[] filters)
Create a CompositeFilter.
|
Filter.Result |
filter(LogEvent event)
Filter an event.
|
Filter.Result |
filter(Logger logger,
Level level,
Marker marker,
Message msg,
Throwable t)
Filter an event.
|
Filter.Result |
filter(Logger logger,
Level level,
Marker marker,
Object msg,
Throwable t)
Filter an event.
|
Filter.Result |
filter(Logger logger,
Level level,
Marker marker,
String msg,
Object... params)
Filter an event.
|
List<Filter> |
getFilters() |
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() |
void |
stop() |
String |
toString() |
equalsImpl, getState, hashCodeImpl, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStoppingclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic CompositeFilter addFilter(Filter filter)
public CompositeFilter removeFilter(Filter filter)
public boolean isEmpty()
public int size()
public void start()
start in interface LifeCyclestart in class AbstractLifeCyclepublic void stop()
stop in interface LifeCyclestop in class AbstractLifeCyclepublic Filter.Result getOnMismatch()
getOnMismatch in interface Filterpublic Filter.Result getOnMatch()
getOnMatch in interface Filterpublic 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)
@PluginFactory public static CompositeFilter createFilters(@PluginElement(value="Filters") Filter[] filters)
filters - An array of Filters to call.Copyright © 1999-2021 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.