You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Hein Meling <me...@acm.org> on 2004/12/22 11:42:24 UTC
ThreadId in the PatternLayout
Hi all.
I've done a simple pattern converter for my own use to distinguish
multiple threads with the same name (some API libraries create multiple
threads with the same name, which sometimes makes it difficult to debug,
e.g. the Jini task manager). I've added the conversion rule below and
the class implementing this is in attachment.
<layout class="org.apache.log4j.PatternLayout">
<conversionRule conversionWord="threadid"
converterClass="jgroup.util.ThreadIdPatternConverter"/>
<param name="ConversionPattern"
value="%-7r %-5p [%t-%threadid] %c{2}.%M: %m%n"/>
</layout>
If this is something that others might benefit from, feel free to
include this in the next release of Log4j.
Hein