public interface Filter extends LifeCycle
This interface supports "global" filters (i.e. - all events must pass through them first), attached to specific loggers and associated with Appenders. It is recommended that, where possible, Filter implementations create a generic filtering method that can be called from any of the filter methods.
Modifier and Type | Interface and Description |
---|---|
static class |
Filter.Result
The result that can returned from a filter method call.
|
LifeCycle.State
Modifier and Type | Field and Description |
---|---|
static String |
ELEMENT_TYPE
Main plugin element type for
Filter plugins.
|
Modifier and Type | Method and Description |
---|---|
Filter.Result |
filter(LogEvent event)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
org.apache.logging.log4j.message.Message msg,
Throwable t)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
Object msg,
Throwable t)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object... params)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1,
Object p2)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7,
Object p8)
Filter an event.
|
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String message,
Object p0,
Object p1,
Object p2,
Object p3,
Object p4,
Object p5,
Object p6,
Object p7,
Object p8,
Object p9)
Filter an event.
|
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.
|
static final String ELEMENT_TYPE
Filter.Result getOnMismatch()
Filter.Result getOnMatch()
Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object... params)
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- String text to filter on.params
- An array of parameters or null.Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1, Object p2)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1, Object p2, Object p3)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parametersp8
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9)
logger
- The Logger.level
- the event logging level.marker
- The Marker for the event or null.message
- The message.p0
- the message parametersp1
- the message parametersp2
- the message parametersp3
- the message parametersp4
- the message parametersp5
- the message parametersp6
- the message parametersp7
- the message parametersp8
- the message parametersp9
- the message parametersFilter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, Object msg, Throwable t)
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- Any Object.t
- A Throwable or null.Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, org.apache.logging.log4j.message.Message msg, Throwable t)
logger
- The Logger.level
- The event logging Level.marker
- The Marker for the event or null.msg
- The Messaget
- A Throwable or null.Filter.Result filter(LogEvent event)
event
- The Event to filter on.Copyright © 1999-2021 The 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.