[logback-user] SiftingAppender question
Gabor Dolla
agdolla at gmail.com
Mon Oct 4 13:17:20 CEST 2010
Hi
Is it possible to configure the SiftingAppender to use parameters from MDC
other than the discriminator ?
I'd like to achive the following :
in java:
MDC.put("logger", loggerName);
MDC.put("file", fileName);
MDC.put("pattern", pattern);
in config:
<appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
<discriminator>
<Key>logger</Key>
<DefaultValue>default</DefaultValue>
</discriminator>
<sift>
<appender name="FILE-${logger}" class="ch.qos.logback.core.FileAppender">
<File>${file}</File>
<Append>true</Append>
<Encoding>UTF-8</Encoding>
<BufferedIO>true</BufferedIO>
<ImmediateFlush>true</ImmediateFlush>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>{pattern:-%d [%thread] %level %mdc %logger{35} - %msg%n}</Pattern>
</layout>
</appender>
</sift>
</appender>
Thanks
Gabor Dolla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20101004/0c924f72/attachment.html>
More information about the Logback-user
mailing list