<font><font face="tahoma,sans-serif">I was missing the <pattern> element. Adding got rid of the error message, but my output is not being formatted. It's like its ignoring the pattern and layout.<br clear="all">
</font></font><br>--adam<br><br><a href="http://gordonizer.com" target="_blank">http://gordonizer.com</a><br><br>
<br><br><div class="gmail_quote">On Tue, Jan 17, 2012 at 13:39, Tony Trinh <span dir="ltr"><<a href="mailto:tony19@gmail.com">tony19@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
See below<br><br><div class="gmail_quote"><div class="im">On Tue, Jan 17, 2012 at 3:10 PM, Adam Gordon <span dir="ltr"><<a href="mailto:adam.n.gordon@gmail.com" target="_blank">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><div>I think you're missing the <font face="'courier new', monospace" color="#ff0000"><pattern></font> tag. Try this:<div><br></div><div><div class="im">
<div><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><font face="'courier new', monospace"> <layout class="ch.qos.logback.classic.PatternLayout"></font></div></div><div><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><font face="'courier new', monospace"> </layout></font></div><div><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 class="im">
<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></div><div class="im">_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">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></div></blockquote></div><br>
<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>