How to enable FINEST java.util.logging in GateIn on JBoss

Version 3
    GateIn comes with JBoss 5.1.0.GA which automatically reroutes all java.util.logging calls to JBoss logger which uses log4j configuration (JBOSS_HOME/server/default/conf/jboss-log4j.xml).

     

    That means that logging.properties configuration file is ignored, and that you configure category thresholds via jboss-log4j.xml.

     

    Let's say you want to log very fine logging messages from PicketLink IDM, which happens to use java.util.logging.

     

    How to configure jboss-log4j.xml for FINEST logging level to appear?

     

    First, make a copy of your default CONSOLE configuration, rename it (i.e. CONSOLE-ALL), and change threshold to TRACE (the most verbose logging level).

     

     

    {code:xml}

       <appender name="CONSOLE-ALL" class="org.apache.log4j.ConsoleAppender">

          <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler" />

          <param name="Target" value="System.out" />

          <param name="Threshold" value="TRACE" />

          <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>

    {code:xml}

     

    Now add category declaration for your desired logger.

     

     

     

    {code:xml}
       <category name="org.picketlink" additivity="false">

          <priority value="TRACE" />

          <appender-ref ref="CONSOLE-ALL" />

       </category>

    {code:xml}

     

     

     

    That's it! All java.util.logging levels will now log to console, displaying their java.util.logging level (FINE, FINER, FINEST ...).

     

    Use TRACE priority to log everything (including FINEST, and FINER).
    Use DEBUG priority to log FINE and above.
    Use INFO priority to log INFO and above.

     

     

    For more on JBoss logging visit http://community.jboss.org/wiki/Logging.