Package com.aspectran.logging
Class LoggingGroupDiscriminator
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.sift.AbstractDiscriminator<ch.qos.logback.classic.spi.ILoggingEvent>
com.aspectran.logging.LoggingGroupDiscriminator
- All Implemented Interfaces:
ch.qos.logback.core.sift.Discriminator<ch.qos.logback.classic.spi.ILoggingEvent>
,ch.qos.logback.core.spi.ContextAware
,ch.qos.logback.core.spi.LifeCycle
public class LoggingGroupDiscriminator
extends ch.qos.logback.core.sift.AbstractDiscriminator<ch.qos.logback.classic.spi.ILoggingEvent>
Discriminates logging events based on the name given to the ActivityContext of the current CoreService.
ex)
<appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
<discriminator class="com.aspectran.core.support.logging.LoggingGroupDiscriminator">
<key>LOGGING_GROUP</key>
<defaultValue>app</defaultValue>
</discriminator>
<sift>
<appender name="FILE-${LOGGING_GROUP}" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${aspectran.basePath:-app}/logs/${LOGGING_GROUP}.log</file>
...
</appender>
</sift>
</appender>
- See Also:
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDiscriminatingValue
(ch.qos.logback.classic.spi.ILoggingEvent event) Returns the name of the current CoreService's ActivityContext.getKey()
void
setDefaultValue
(String defaultValue) void
void
start()
Methods inherited from class ch.qos.logback.core.sift.AbstractDiscriminator
isStarted, stop
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Constructor Details
-
LoggingGroupDiscriminator
public LoggingGroupDiscriminator()
-
-
Method Details
-
getDiscriminatingValue
Returns the name of the current CoreService's ActivityContext. If that value is null, then return the value assigned to the defaultValue property. -
getKey
-
setKey
-
getDefaultValue
-
setDefaultValue
-
start
public void start()- Specified by:
start
in interfacech.qos.logback.core.spi.LifeCycle
- Overrides:
start
in classch.qos.logback.core.sift.AbstractDiscriminator<ch.qos.logback.classic.spi.ILoggingEvent>
-