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
Nested ClassesModifier and TypeClassDescriptionstatic classSubclasses can extend this abstract Builder.Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State -
Field Summary
FieldsFields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractFilterable(Filter filter) protectedAbstractFilterable(Filter filter, Property[] propertyArray) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a filter.Returns the Filter.Property[]booleanDetermines if a Filter is present.booleanisFiltered(LogEvent event) Determine if the LogEvent should be processed or ignored.voidremoveFilter(Filter filter) Removes a Filter.voidstart()Make the Filter available for use.booleanCleanup the Filter.protected booleanCleanup 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
-
Field Details
-
filter
May be null. -
propertyArray
-
-
Constructor Details
-
AbstractFilterable
protected AbstractFilterable() -
AbstractFilterable
-
AbstractFilterable
- Since:
- 2.11.2
-
-
Method Details
-
addFilter
Adds a filter.- Specified by:
addFilterin interfaceFilterable- Parameters:
filter- The Filter to add.
-
getFilter
Returns the Filter.- Specified by:
getFilterin interfaceFilterable- Returns:
- the Filter or null.
-
hasFilter
public boolean hasFilter()Determines if a Filter is present.- Specified by:
hasFilterin interfaceFilterable- Returns:
- false if no Filter is present.
-
isFiltered
Determine if the LogEvent should be processed or ignored.- Specified by:
isFilteredin interfaceFilterable- Parameters:
event- The LogEvent.- Returns:
- true if the LogEvent should be processed.
-
removeFilter
Removes a Filter.- Specified by:
removeFilterin interfaceFilterable- Parameters:
filter- The Filter to remove.
-
start
public void start()Make the Filter available for use.- Specified by:
startin interfaceLifeCycle- Overrides:
startin classAbstractLifeCycle
-
stop
Cleanup the Filter.- Specified by:
stopin interfaceLifeCycle2- Overrides:
stopin 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
-