Class CombinedMdcDiscriminator
- java.lang.Object
-
- com.xebialabs.platform.test.testng.CombinedMdcDiscriminator
-
- All Implemented Interfaces:
ch.qos.logback.core.sift.Discriminator<ch.qos.logback.classic.spi.ILoggingEvent>,ch.qos.logback.core.spi.LifeCycle
public class CombinedMdcDiscriminator extends java.lang.Object implements ch.qos.logback.core.sift.Discriminator<ch.qos.logback.classic.spi.ILoggingEvent>Interacts with test setup code that sets a MDC ProvisionedVm to the VM being provisioned. And for TestNG add the MdcTestListener to a test case to set the test name in the MDC. Use as follows:<appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"> <discriminator class="com.xebialabs.probsels.CombinedMdcDiscriminator" /> <sift> <appender name="${logname}" class="ch.qos.logback.core.FileAppender"> <file>${logname}.log</file> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] {%mdc} %-5level %logger{36} - %msg%n%rootException</pattern> </layout> </appender> </sift> </appender>
-
-
Constructor Summary
Constructors Constructor Description CombinedMdcDiscriminator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDiscriminatingValue(ch.qos.logback.classic.spi.ILoggingEvent iLoggingEvent)java.lang.StringgetKey()booleanisStarted()voidstart()voidstop()
-
-
-
Method Detail
-
getDiscriminatingValue
public java.lang.String getDiscriminatingValue(ch.qos.logback.classic.spi.ILoggingEvent iLoggingEvent)
- Specified by:
getDiscriminatingValuein interfacech.qos.logback.core.sift.Discriminator<ch.qos.logback.classic.spi.ILoggingEvent>
-
getKey
public java.lang.String getKey()
- Specified by:
getKeyin interfacech.qos.logback.core.sift.Discriminator<ch.qos.logback.classic.spi.ILoggingEvent>
-
start
public void start()
- Specified by:
startin interfacech.qos.logback.core.spi.LifeCycle
-
stop
public void stop()
- Specified by:
stopin interfacech.qos.logback.core.spi.LifeCycle
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfacech.qos.logback.core.spi.LifeCycle
-
-