4 Replies Latest reply on Apr 30, 2009 12:42 AM by Ali Gohar

    JBoss logging configuration

    Ali Gohar Newbie

      Hi,

      I've deployed an application to jboss, which uses some third party libraries and these libraries use java.util.logging for logs. I want to enable TRACE level logging for those specific APIs. I tried to set the log level to TRACE in log4j.xml file in conf directory of JBoss but it doesn't set the log level to TRACE for those particular libraries, the logging information for those libraries is still DEBUG level.

      Can anyone please let me know how can I set TRACE level logging for java.util.logging package in JBoss?

      Thanks

        • 1. Re: JBoss logging configuration
          Peter Johnson Master

          Since you mentioned log4j.xml, I am going ot assume that you are using a really old version of JBoss AS, such as 4.0.x or 3.2.x. In the 4.0.5 log4j.xml file there is a commented-out category that shows how to set trace level logging:

          <category name="jbossws.SOAPMessage">
           <priority value="TRACE" class="org.jboss.logging.XLevel"/>
           </category>
          


          • 2. Re: JBoss logging configuration
            Dimitris Andreadis Master

            Actually since AS 4.2.x TRACE is supported natively by log4j so you can just say

            <category name="bla>
             <priority value="TRACE"/>
            </category>
            

            Now, AS 5.1.x includes a logging bridge between java.util.logging and log4j, meaning that the levels you set in the log4j config are propagated to the java.util.logging side.

            To set levels that appears only in java.util.logging you can use org.jboss.logging.log4j.JDKLevel, e.g.
             <!-- Set the logging level of the JSF implementation that uses
             | java.util.logging. The jdk logging levels can be controlled
             | through the org.jboss.logging.log4j.JDKLevel class that
             | in addition to the standard log4j levels it adds support for
             | SEVERE, WARNING, CONFIG, FINE, FINER, FINEST
             -->
             <category name="javax.enterprise.resource.webcontainer.jsf">
             <priority value="FINE" class="org.jboss.logging.log4j.JDKLevel"/>
             </category>
            

            Before AS 5.1 this is not supported.

            • 3. Re: JBoss logging configuration
              Ali Gohar Newbie

              Hi,

              Thank you for replies. Yes i was using older version of jboss and worked for me.

              cheers

              • 4. Re: JBoss logging configuration
                Ali Gohar Newbie

                Hi,

                Thank you for replies. Yes i was using older version of jboss and

                <priority value="TRACE" class="org.jboss.logging.XLevel"/>
                worked for me.

                cheers