[logback-user] Custom LayoutWrappingEncoder question

Adam Gordon adam.n.gordon at gmail.com
Tue Jan 17 21:10:51 CET 2012


I'm using a custom LayoutWrappingEncoder to colorize and selectively
timestamp my log file entries.  This encoder is configured via the
<encoder> element in my logback XML file.  My question is, with a custom
encoder, is there a way I can specify a <layout> element in my <encoder>
element and use the built in layout patterns?

I've tried:

    <encoder class="com.bar.foo.CustomLayoutWrappingEncoder">
      <layout class="ch.qos.logback.classic.PatternLayout">
        [level] - %logger{15}: %message%n x%Ex{full}
      </layout>
    </encoder>

But I'm seeing the following error in the console when testing that:

13:06:58,318 |-ERROR in ch.qos.logback.classic.PatternLayout("null") -
Empty or null pattern.

Am I doing this correctly?

Thanks,

--adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120117/e31561e8/attachment.html>


More information about the Logback-user mailing list