Package ch.qos.logback.classic.sift
Class JNDIBasedContextDiscriminator
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.sift.AbstractDiscriminator<ILoggingEvent>
ch.qos.logback.classic.sift.JNDIBasedContextDiscriminator
- All Implemented Interfaces:
Discriminator<ILoggingEvent>,ContextAware,LifeCycle
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
startedFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDiscriminatingValue(ILoggingEvent event)Return the name of the current context name as found in the logging event.getKey()voidsetDefaultValue(String defaultValue)The default context name in case the context name is not set for the current logging event.voidMethods inherited from class ch.qos.logback.core.sift.AbstractDiscriminator
isStarted, start, stopMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Constructor Details
-
JNDIBasedContextDiscriminator
public JNDIBasedContextDiscriminator()
-
-
Method Details
-
getDiscriminatingValue
Return the name of the current context name as found in the logging event. -
getKey
-
setKey
-
getDefaultValue
- Returns:
- See Also:
setDefaultValue(String)
-
setDefaultValue
The default context name in case the context name is not set for the current logging event.- Parameters:
defaultValue-
-