See below<br><br><div class="gmail_quote">On Tue, Jan 17, 2012 at 3:10 PM, Adam Gordon <span dir="ltr"><<a href="mailto:adam.n.gordon@gmail.com">adam.n.gordon@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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></font></div></blockquote><div><br></div><div>I think you're missing the <font face="'courier new', monospace" color="#ff0000"><pattern></font> tag. Try this:<div><br></div><div><div style><span style="font-family:'courier new',monospace"> </span><span style="font-family:'courier new',monospace"> </span><font face="'courier new', monospace"><encoder class="com.bar.foo.CustomLayoutWrappingEncoder"></font></div>
<div style><font face="'courier new', monospace"> <layout class="ch.qos.logback.classic.PatternLayout"></font></div><div style><font face="'courier new', monospace"><font color="#222222"> </font><b> <font color="#ff0000"><pattern></font></b><font color="#222222">[level] - %logger{15}: %message%n %xEx{full}</font><b><font color="#ff0000"></pattern></font></b></font></div>
<div style><font face="'courier new', monospace"> </layout></font></div><div style><font face="'courier new', monospace"> </encoder></font></div></div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font face="tahoma, sans-serif"><div>
</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>
<br>_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br></blockquote></div><br>