1 Reply Latest reply on Dec 2, 2004 9:45 AM by analogueboy

    Debug logging for Hibernate

    eugene_prokopiev

      Hi,

      I need to debug Hibernate in JBoss 4. I modified file server/default/conf/log4j.xml in default installation:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
      
      <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
      
       <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">
       <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
       </layout>
       </appender>
      
       <category name="org.apache">
       <priority value="INFO"/>
       </category>
      
       <category name="org.jgroups">
       <priority value="WARN"/>
       </category>
      
       <category name="net.sf.hibernate">
       <priority value="DEBUG"/>
       </category>
      
       <category name="org.jboss">
       <priority value="INFO"/>
       </category>
      
       <root>
       <appender-ref ref="CONSOLE"/>
       </root>
      
      </log4j:configuration>
      


      But there are no DEBUG messages on console. What is wrong?

        • 1. Re: Debug logging for Hibernate
          analogueboy

          not sure if its the best way forward, but we've set the level for the appender to debug and then change the categories that we don't want to lower levels, for example, org.jboss is at warn.

          This works fine for us, it seemed that the appender settings took preference over categories. I may need to RTFM tho...