Top Description Fields Constructors Methods
ch.qos.logback.classic.sift

public Class ContextBasedDiscriminator

extends AbstractDiscriminator<ILoggingEvent>
Class Inheritance
Imports
ch.qos.logback.classic.spi.ILoggingEvent, ch.qos.logback.core.sift.AbstractDiscriminator

This discriminator returns the value context to which this event is attached to. 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

Modifier and TypeField and Description
private String
private static final String
Inherited from ch.qos.logback.core.sift.AbstractDiscriminator:
started

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public String
getDiscriminatingValue(ILoggingEvent event)

Implements ch.qos.logback.core.sift.Discriminator.getDiscriminatingValue.

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

Implements ch.qos.logback.core.sift.Discriminator.getKey.

The key or variable name under which the discriminating value should be exported into the host environment.
public void
setDefaultValue(String defaultValue)

The default context name in case the context name is not set for the current logging event.

public void
Inherited from ch.qos.logback.core.sift.AbstractDiscriminator:
isStartedstartstop

Field Detail

defaultValueback to summary
private String defaultValue
KEYback to summary
private static final String KEY

Constructor Detail

ContextBasedDiscriminatorback to summary
public ContextBasedDiscriminator()

Method Detail

getDefaultValueback to summary
public String getDefaultValue()
See Also
setDefaultValue(String)
getDiscriminatingValueback to summary
public String getDiscriminatingValue(ILoggingEvent event)

Implements ch.qos.logback.core.sift.Discriminator.getDiscriminatingValue.

Return the name of the current context name as found in the logging event.

getKeyback to summary
public String getKey()

Implements ch.qos.logback.core.sift.Discriminator.getKey.

Doc from ch.qos.logback.core.sift.Discriminator.getKey.

The key or variable name under which the discriminating value should be exported into the host environment.

setDefaultValueback to summary
public void setDefaultValue(String defaultValue)

The default context name in case the context name is not set for the current logging event.

setKeyback to summary
public void setKey(String key)