public class MDCBasedDiscriminator extends ContextAwareBase implements Discriminator<ILoggingEvent>
Both Key and the DefaultValue are user specified properties.
context
Constructor and Description |
---|
MDCBasedDiscriminator() |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultValue() |
String |
getDiscriminatingValue(ILoggingEvent event)
Return the value associated with an MDC entry designated by the Key
property.
|
String |
getKey() |
boolean |
isStarted() |
void |
setDefaultValue(String defaultValue)
The default MDC value in case the MDC is not set for
mdcKey . |
void |
setKey(String key) |
void |
start() |
void |
stop() |
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
public String getDiscriminatingValue(ILoggingEvent event)
getDiscriminatingValue
in interface Discriminator<ILoggingEvent>
public String getKey()
getKey
in interface Discriminator<ILoggingEvent>
public void setKey(String key)
public String getDefaultValue()
setDefaultValue(String)
public void setDefaultValue(String defaultValue)
mdcKey
.
For example, if Key
is set to the value
"someKey", and the MDC is not set for "someKey", then this appender will
use the default value, which you can set with the help of this method.
defaultValue
- Copyright © 2005-2013 QOS.ch. All Rights Reserved.