Interface Filterable
- All Superinterfaces:
LifeCycle
- All Known Subinterfaces:
Configuration
- All Known Implementing Classes:
AbstractAppender
,AbstractConfiguration
,AbstractDatabaseAppender
,AbstractFileAppender
,AbstractFilterable
,AbstractOutputStreamAppender
,AbstractWriterAppender
,AppenderControl
,AsyncAppender
,AsyncLoggerConfig
,AsyncLoggerConfig.RootLogger
,BuiltConfiguration
,CompositeConfiguration
,ConsoleAppender
,CountingNoOpAppender
,DefaultConfiguration
,FailoverAppender
,FileAppender
,HttpAppender
,JdbcAppender
,JeroMqAppender
,JmsAppender
,JsonConfiguration
,KafkaAppender
,LoggerConfig
,LoggerConfig.RootLogger
,MemoryMappedFileAppender
,NoSqlAppender
,NullAppender
,NullConfiguration
,OutputStreamAppender
,PropertiesConfiguration
,RandomAccessFileAppender
,RewriteAppender
,RollingFileAppender
,RollingRandomAccessFileAppender
,RoutingAppender
,ScriptAppenderSelector
,SmtpAppender
,SocketAppender
,SyslogAppender
,WriterAppender
,XmlConfiguration
,YamlConfiguration
Interface implemented by Classes that allow filtering to occur.
Extends LifeCycle
since filters have a life cycle.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new Filter.Returns an Iterator for all the Filters.boolean
Determine if a Filter is present.boolean
isFiltered
(LogEvent event) Determines if the event should be filtered.void
removeFilter
(Filter filter) Removes a Filter.
-
Method Details
-
addFilter
Adds a new Filter. If a Filter already exists it is converted to a CompositeFilter.- Parameters:
filter
- The Filter to add.
-
removeFilter
Removes a Filter.- Parameters:
filter
- The Filter to remove.
-
getFilter
Filter getFilter()Returns an Iterator for all the Filters.- Returns:
- an Iterator for all the Filters.
-
hasFilter
boolean hasFilter()Determine if a Filter is present.- Returns:
- true if a Filter is present, false otherwise.
-
isFiltered
Determines if the event should be filtered.- Parameters:
event
- The LogEvent.- Returns:
- true if the event should be filtered, false otherwise.
-