[logback-user] Reference to encoders o patterns?

César Álvarez Núñez cesar.alvarez.nunez at gmail.com
Tue May 11 12:34:28 CEST 2010

Hi All,

Is there some way to make a reference to an encoder or pattern defined
previously via a reference or similar?
I've tried with the bellow configuration but it does not work :-(

    <encoder name="ENC-1"class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
        <Pattern>%date %.-1level [%mdc{SessionID}] [%t] %logger{32} -

    <encoder name="ENC-2"class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
        <Pattern>%date %.-1level [%mdc{SessionID}] [%t] %logger{32} -

    <appender name="STDOUT-1" class="ch.qos.logback.core.ConsoleAppender">
        <encoder-ref ref="ENC-1"/>

    <appender name="STDOUT-2" class="ch.qos.logback.core.ConsoleAppender">
        <encoder-ref ref="ENC-2"/>

    <logger name="X.Y">
        <level value="INFO" />
        <appender-ref ref="STDOUT-2" />

    <root level="DEBUG">
        <appender-ref ref="STDOUT-1" />

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20100511/dccbe394/attachment-0001.html>

More information about the Logback-user mailing list