ch.qos.logback.classic.sift
Class JNDIBasedContextDiscriminator

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.sift.AbstractDiscriminator<ILoggingEvent>
          extended by ch.qos.logback.classic.sift.JNDIBasedContextDiscriminator
All Implemented Interfaces:
Discriminator<ILoggingEvent>, ContextAware, LifeCycle

public class JNDIBasedContextDiscriminator
extends AbstractDiscriminator<ILoggingEvent>

This discriminator returns the value context as determined by JNDI. If the said value is null, then a default value is returned.

Both Key and the DefaultValue are user specified properties.

Author:
Ceki Gülcü

Field Summary
 
Fields inherited from class ch.qos.logback.core.sift.AbstractDiscriminator
started
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
JNDIBasedContextDiscriminator()
           
 
Method Summary
 String getDefaultValue()
           
 String getDiscriminatingValue(ILoggingEvent event)
          Return the name of the current context name as found in the logging event.
 String getKey()
           
 void setDefaultValue(String defaultValue)
          The default context name in case the context name is not set for the current logging event.
 void setKey(String key)
           
 
Methods inherited from class ch.qos.logback.core.sift.AbstractDiscriminator
isStarted, start, stop
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNDIBasedContextDiscriminator

public JNDIBasedContextDiscriminator()
Method Detail

getDiscriminatingValue

public String getDiscriminatingValue(ILoggingEvent event)
Return the name of the current context name as found in the logging event.


getKey

public String getKey()

setKey

public void setKey(String key)

getDefaultValue

public String getDefaultValue()
Returns:
See Also:
setDefaultValue(String)

setDefaultValue

public void setDefaultValue(String defaultValue)
The default context name in case the context name is not set for the current logging event.

Parameters:
defaultValue -


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