There are two important parts to tweaking your logging, the appender settings and limit categories.
The appender settings start on line 64 for jboss-4.2.2.GA. The default is :
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
</layout>
</appender>
Mine look like this :
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%-5p [%c{7}.%M] %m %n"/>
</layout>
</appender>
The difference is the ConversionPattern. Inside the brackets I use %c{7}.%M. That means that the class name will append 7 levels back, i.e. com.foo.bar.baz.buz.bam.SomeClass. The ".%M" appends the method name as well, i.e. com.foo.bar.baz.buz.bam.SomeClass.someMethod.
This way I can see the fully qualified class name and method.
No comments:
Post a Comment