1 Reply Latest reply on Jan 10, 2006 5:16 PM by damo9f

    Logging level set to trace Programmatically

    damo9f Newbie


      I'd like to turn trace-level logging on for a short time to debug a classloading issue. I've tried:

       Logger.getLogger("org.jboss.mx.loading").setLevel(XLevel.TRACE);
       x = new NotLoadingClass();
       Logger.getLogger("org.jboss.mx.loading").setLevel(Level.INFO);
      


      but that didn't work. Does anyone know how to do this?

        • 1. Re: Logging level set to trace Programmatically
          damo9f Newbie


          I have not found a programmatic setup, but this log4j.xml entry works to set logging statically:

          <appender name="UCL" class="org.apache.log4j.FileAppender">
           <param name="File" value="${jboss.server.home.dir}/log/ucl.log"/>
           <param name="Append" value="false"/>
           <layout class="org.apache.log4j.PatternLayout">
           <param name="ConversionPattern" value="[%r,%c{1},%t] %m%n"/>
           </layout>
          </appender>
          <category name="org.jboss.mx.loading" additivity="false">
           <priority value="TRACE" class="org.jboss.logging.XLevel"/>
           <appender-ref ref="UCL"/>
          </category>
          


          The snippet is from:

          http://docs.jboss.org/jbossas/jboss4guide/r1/html/ch2.chapter.html#ch2.log4j.ex