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

java.lang.Object
  extended by org.apache.logging.log4j.core.filter.FilterBase
      extended by org.apache.logging.log4j.core.filter.MapFilter
          extended by org.apache.logging.log4j.core.filter.StructuredDataFilter
All Implemented Interfaces:
Filter, Lifecycle

public final class StructuredDataFilter
extends MapFilter

Filter based on data in a StructuredDataMessage.


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.FilterBase
LOGGER, onMatch, onMismatch
 
Method Summary
static StructuredDataFilter createFilter(KeyValuePair[] pairs, String oper, String match, String mismatch)
          Create the StructuredDataFilter.
 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  Filter.Result filter(MapMessage message)
           
 String toString()
           
 
Methods inherited from class org.apache.logging.log4j.core.filter.MapFilter
getMap, isAnd
 
Methods inherited from class org.apache.logging.log4j.core.filter.FilterBase
filter, filter, getOnMatch, getOnMismatch, isStarted, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

filter

public Filter.Result filter(Logger logger,
                            Level level,
                            Marker marker,
                            Message msg,
                            Throwable t)
Description copied from class: FilterBase
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: FilterBase
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(MapMessage message)
Overrides:
filter in class MapFilter

toString

public String toString()
Overrides:
toString in class MapFilter

createFilter

public static StructuredDataFilter createFilter(KeyValuePair[] pairs,
                                                String oper,
                                                String match,
                                                String 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-2012 Apache Software Foundation. All Rights Reserved.