@Plugin(name="MapFilter", category="Core", elementType="filter", printObject=true) public class MapFilter extends AbstractFilter
Filter.Result
LifeCycle.State
onMatch, onMismatch
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
ELEMENT_TYPE
Modifier | Constructor and Description |
---|---|
protected |
MapFilter(Map<String,List<String>> map,
boolean oper,
Filter.Result onMatch,
Filter.Result onMismatch) |
Modifier and Type | Method and Description |
---|---|
static MapFilter |
createFilter(KeyValuePair[] pairs,
String oper,
Filter.Result match,
Filter.Result mismatch) |
Filter.Result |
filter(LogEvent event)
Context Filter method.
|
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)
Appender Filter method.
|
protected boolean |
filter(Map<String,String> data) |
protected Map<String,List<String>> |
getMap() |
protected boolean |
isAnd() |
String |
toString() |
equalsImpl, filter, filter, getOnMatch, getOnMismatch, hashCodeImpl
getState, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start, stop
protected MapFilter(Map<String,List<String>> map, boolean oper, Filter.Result onMatch, Filter.Result onMismatch)
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)
AbstractFilter
filter
in interface Filter
filter
in class AbstractFilter
logger
- the Logger.level
- The logging Level.marker
- The Marker, if any.msg
- The message, if present.t
- A throwable or null.public Filter.Result filter(LogEvent event)
AbstractFilter
filter
in interface Filter
filter
in class AbstractFilter
event
- The LogEvent.public String toString()
toString
in class AbstractFilter
protected boolean isAnd()
@PluginFactory public static MapFilter createFilter(@PluginElement(value="Pairs") KeyValuePair[] pairs, @PluginAttribute(value="operator") String oper, @PluginAttribute(value="onMatch") Filter.Result match, @PluginAttribute(value="onMismatch") Filter.Result mismatch)
Copyright © 1999-2021 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.