See belowOn Tue, Jan 17, 2012 at 3:10 PM, Adam Gordon <adam.n.gordon@gmail.com> wrote:
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>
I think you're missing the <pattern> tag. Try this:<encoder class="com.bar.foo.CustomLayoutWrappingEncoder"><layout class="ch.qos.logback.classic.PatternLayout"><pattern>[level] - %logger{15}: %message%n %xEx{full}</pattern></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_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user