Class FilterAdapter
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.filter.AbstractFilter
org.apache.log4j.bridge.FilterAdapter
- All Implemented Interfaces:
Filter, LifeCycle, LifeCycle2
Binds a Log4j 1.x Filter with Log4j 2.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractFilter
AbstractFilter.AbstractFilterBuilder<B>Nested classes/interfaces inherited from interface Filter
Filter.ResultNested classes/interfaces inherited from interface LifeCycle
LifeCycle.State -
Field Summary
FieldsFields inherited from class AbstractFilter
onMatch, onMismatchFields inherited from class AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGERFields inherited from interface Filter
ELEMENT_TYPE, EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractFilter
equalsImpl, filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, getOnMatch, getOnMismatch, hashCodeImpl, toStringMethods inherited from class AbstractLifeCycle
getState, getStatusLogger, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop, stop
-
Field Details
-
filter
-
-
Constructor Details
-
FilterAdapter
-
-
Method Details
-
adapt
Adapts a Log4j 1.x filter into a Log4j 2.x filter. Applying this method to the result ofFilterWrapper.adapt(org.apache.logging.log4j.core.Filter)should return the original Log4j 2.x filter.- Parameters:
filter- a Log4j 1.x filter- Returns:
- a Log4j 2.x filter or
nullif the parameter isnull
-
addFilter
-
filter
Description copied from class:AbstractFilterContext Filter method. The default returns NEUTRAL.- Specified by:
filterin interfaceFilter- Overrides:
filterin classAbstractFilter- Parameters:
event- The LogEvent.- Returns:
- The Result of filtering.
-
getFilter
-
start
public void start()- Specified by:
startin interfaceLifeCycle- Overrides:
startin classAbstractLifeCycle
-