org.apache.logging.log4j.core.filter
Class StructuredDataFilter
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.filter.AbstractFilter
org.apache.logging.log4j.core.filter.MapFilter
org.apache.logging.log4j.core.filter.StructuredDataFilter
- All Implemented Interfaces:
- Serializable, Filter, LifeCycle
@Plugin(name="StructuredDataFilter",
category="Core",
elementType="filter",
printObject=true)
public final class StructuredDataFilter
- extends MapFilter
Filter based on data in a StructuredDataMessage.
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.Filter |
Filter.Result |
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle |
getState, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start, stop |
filter
public 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)
- Description copied from class:
AbstractFilter
- Appender Filter method. The default returns NEUTRAL.
- Specified by:
filter
in interface Filter
- Overrides:
filter
in class MapFilter
- Parameters:
logger
- the Logger.level
- The logging Level.marker
- The Marker, if any.msg
- The message, if present.t
- A throwable or null.
- Returns:
- The Result of filtering.
filter
public Filter.Result filter(LogEvent event)
- Description copied from class:
AbstractFilter
- Context Filter method. The default returns NEUTRAL.
- Specified by:
filter
in interface Filter
- Overrides:
filter
in class MapFilter
- Parameters:
event
- The LogEvent.
- Returns:
- The Result of filtering.
filter
protected Filter.Result filter(org.apache.logging.log4j.message.StructuredDataMessage message)
createFilter
@PluginFactory
public static StructuredDataFilter createFilter(@PluginElement(value="Pairs")
KeyValuePair[] pairs,
@PluginAttribute(value="operator")
String oper,
@PluginAttribute(value="onMatch")
Filter.Result match,
@PluginAttribute(value="onMismatch")
Filter.Result mismatch)
- Create the StructuredDataFilter.
- Parameters:
pairs
- Key and value pairs.oper
- The operator to perform. If not "or" the operation will be an "and".match
- The action to perform on a match.mismatch
- The action to perform on a mismatch.
- Returns:
- The StructuredDataFilter.
Copyright © 1999-2015 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.