ch.qos.logback.classic.turbo
Class MDCFilter

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.classic.turbo.TurboFilter
          extended by ch.qos.logback.classic.turbo.MatchingFilter
              extended by ch.qos.logback.classic.turbo.MDCFilter
All Implemented Interfaces:
ContextAware, LifeCycle

public class MDCFilter
extends MatchingFilter

This class allows output for a given MDC value.

When the given value is identified by this TubroFilter, the reply is based on the OnMatch option. The information is taken from the MDC. For this TurboFilter to work, one must set the key that will be used to access the information in the MDC.

To allow output for the value, set the OnMatch option to ACCEPT. To disable output for the given value, set the OnMatch option to DENY.

By default, values of the OnMatch and OnMisMatch options are set to NEUTRAL.

Author:
Ceki Gülcü, Sébastien Pennec

Field Summary
 
Fields inherited from class ch.qos.logback.classic.turbo.MatchingFilter
onMatch, onMismatch
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
MDCFilter()
           
 
Method Summary
 FilterReply decide(org.slf4j.Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t)
          Make a decision based on the multiple parameters passed as arguments.
 void setMDCKey(String MDCKey)
           
 void setValue(String value)
           
 
Methods inherited from class ch.qos.logback.classic.turbo.MatchingFilter
setOnMatch, setOnMismatch
 
Methods inherited from class ch.qos.logback.classic.turbo.TurboFilter
getName, isStarted, setName, start, stop
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MDCFilter

public MDCFilter()
Method Detail

decide

public FilterReply decide(org.slf4j.Marker marker,
                          Logger logger,
                          Level level,
                          String format,
                          Object[] params,
                          Throwable t)
Description copied from class: TurboFilter
Make a decision based on the multiple parameters passed as arguments. The returned value should be one of FilterReply.DENY, FilterReply.NEUTRAL, or FilterReply.ACCEPT.

Specified by:
decide in class TurboFilter
Returns:

setValue

public void setValue(String value)

setMDCKey

public void setMDCKey(String MDCKey)


Copyright © 2005-2011 QOS.ch. All Rights Reserved.