Tuesday, June 23, 2009

Adjusting log4j in JBoss

JBoss' log4j configuration can be found at [server root]/server/default/conf/jboss-log4j.xml.

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.

Sunday, June 21, 2009

Distilled Brilliance on Python Integer equality

Excellent blog post on DZone this morning. I like the name of this blog, "Distilled Brilliance," too.

Wednesday, June 10, 2009

Safari 4

If you are a Mac user run Software Update and get Safari 4 now.

This release is significantly faster in loading pages and url completion.

The new "Top Sites" feature is really cool. Apple cribbed it from Opera, but they've improved on it.