<font face="tahoma, sans-serif">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?</font>
<div><font face="tahoma, sans-serif"><br></font></div><div><font face="tahoma, sans-serif">I've tried:</font></div><div><font face="tahoma, sans-serif"><br></font></div><div><font face="tahoma, sans-serif"><div> <encoder class="com.bar.foo.CustomLayoutWrappingEncoder"></div>
<div> <layout class="ch.qos.logback.classic.PatternLayout"></div><div> [level] - %logger{15}: %message%n x%Ex{full}</div><div> </layout></div><div> </encoder></div><div><br>
</div><div>But I'm seeing the following error in the console when testing that:</div><div><br></div><div><div>13:06:58,318 |-ERROR in ch.qos.logback.classic.PatternLayout("null") - Empty or null pattern.</div>
</div><div><br></div><div>Am I doing this correctly?</div><div><br></div><div>Thanks,</div><div><br></div><div>--adam</div></font></div>