org.apache.logging.log4j.core.filter
Class MapFilter

java.lang.Object
  extended by org.apache.logging.log4j.core.filter.AbstractFilter
      extended by org.apache.logging.log4j.core.filter.MapFilter
All Implemented Interfaces:
Filter, LifeCycle
Direct Known Subclasses:
StructuredDataFilter, ThreadContextMapFilter

public class MapFilter
extends AbstractFilter

A Filter that operates on a Map.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.Filter
Filter.Result
 
Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.filter.AbstractFilter
LOGGER, onMatch, onMismatch
 
Constructor Summary
protected MapFilter(Map<String,List<String>> map, boolean oper, Filter.Result onMatch, Filter.Result onMismatch)
           
 
Method Summary
static MapFilter createFilter(KeyValuePair[] pairs, String oper, String match, String mismatch)
           
 Filter.Result filter(LogEvent event)
          Context Filter method.
 Filter.Result filter(Logger logger, Level level, Marker marker, 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()
           
 
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilter
filter, filter, getOnMatch, getOnMismatch, isStarted, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapFilter

protected MapFilter(Map<String,List<String>> map,
                    boolean oper,
                    Filter.Result onMatch,
                    Filter.Result onMismatch)
Method Detail

filter

public Filter.Result filter(Logger logger,
                            Level level,
                            Marker marker,
                            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 AbstractFilter
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 AbstractFilter
Parameters:
event - The LogEvent.
Returns:
The Result of filtering.

filter

protected boolean filter(Map<String,String> data)

toString

public String toString()
Overrides:
toString in class AbstractFilter

isAnd

protected boolean isAnd()

getMap

protected Map<String,List<String>> getMap()

createFilter

public static MapFilter createFilter(KeyValuePair[] pairs,
                                     String oper,
                                     String match,
                                     String mismatch)


Copyright © 1999-2013 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.