Class AbstractFilterable
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.filter.AbstractFilterable
- All Implemented Interfaces:
Filterable
,LifeCycle
,LifeCycle2
- Direct Known Subclasses:
AbstractAppender
,AbstractConfiguration
,AppenderControl
,LoggerConfig
Enhances a Class by allowing it to contain Filters.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Subclasses can extend this abstract Builder.Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
AbstractFilterable
(Filter filter) protected
AbstractFilterable
(Filter filter, Property[] propertyArray) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a filter.Returns the Filter.Property[]
boolean
Determines if a Filter is present.boolean
isFiltered
(LogEvent event) Determine if the LogEvent should be processed or ignored.void
removeFilter
(Filter filter) Removes a Filter.void
start()
Make the Filter available for use.boolean
Cleanup the Filter.protected boolean
Cleanup the Filter.Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
Constructor Details
-
AbstractFilterable
protected AbstractFilterable() -
AbstractFilterable
-
AbstractFilterable
- Since:
- 2.11.2
-
-
Method Details
-
addFilter
Adds a filter.- Specified by:
addFilter
in interfaceFilterable
- Parameters:
filter
- The Filter to add.
-
getFilter
Returns the Filter.- Specified by:
getFilter
in interfaceFilterable
- Returns:
- the Filter or null.
-
hasFilter
public boolean hasFilter()Determines if a Filter is present.- Specified by:
hasFilter
in interfaceFilterable
- Returns:
- false if no Filter is present.
-
isFiltered
Determine if the LogEvent should be processed or ignored.- Specified by:
isFiltered
in interfaceFilterable
- Parameters:
event
- The LogEvent.- Returns:
- true if the LogEvent should be processed.
-
removeFilter
Removes a Filter.- Specified by:
removeFilter
in interfaceFilterable
- Parameters:
filter
- The Filter to remove.
-
start
public void start()Make the Filter available for use.- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classAbstractLifeCycle
-
stop
Cleanup the Filter.- Specified by:
stop
in interfaceLifeCycle2
- Overrides:
stop
in classAbstractLifeCycle
- Parameters:
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argument- Returns:
- true if the receiver was stopped cleanly and normally, false otherwise.
-
stop
Cleanup the Filter. -
getPropertyArray
-