2 Replies Latest reply on Nov 12, 2004 2:47 PM by Steven Grimm

    How to get debug messages out of Tomcat (JBoss 4.0.1RC1)?

    Steven Grimm Newbie

      I'm trying to debug a problem and I'd like to turn on Tomcat's debug logging. I have tried editing my jbossweb-tomcat50.sar/server.xml file to include a logger, like so:

      <Logger className="org.jboss.web.tomcat.Log4jLogger"
       verbosityLevel="DEBUG"
       category="org.jboss.web"/>

      (I inserted that directly above the existing Logger) and for my trouble, all I get is this message:

      00:15:21,682 INFO [STDOUT] Can't find resource org.jboss.web.tomcat.session.LocalStrings org.jboss.web.tomcat.tc5.WebCtxLoader$ENCLoader@970110
      00:15:21,686 INFO [STDOUT] [Ljava.net.URL;@1ec6b9

      What else should I be doing to open the floodgates of Tomcat's debug log messages?

      I am using 4.0.1RC1 because I was running into bug 1037726 under 4.0.0.

        • 1. Re: How to get debug messages out of Tomcat (JBoss 4.0.1RC1)
          Anil Saldanha Master

          try conf/log4j.xml of your server configuration like "default", "all"

          • 2. Re: How to get debug messages out of Tomcat (JBoss 4.0.1RC1)
            Steven Grimm Newbie

            Thanks, that helped. In case someone else comes across this thread looking to do the same thing in the future, I ended up making two changes in addition to the one in my initial message. First, I edited conf/log4j.xml and added:

            <appender name="DEBUGCONSOLE" class="org.apache.log4j.ConsoleAppender">
             <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
             <param name="Target" value="System.out"/>
             <param name="Threshold" value="DEBUG"/>
            
             <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>
            
             <category name="org.jboss.web">
             <priority value="DEBUG"/>
             <appender-ref ref="DEBUGCONSOLE" />
             </category>

            That causes Tomcat's debug messages to be printed to the console without doing the same for all the other modules.

            Next, I extracted the file org/jboss/web/tomcat/tc5/session/LocalStrings.properties from tomcat50-service.jar and moved it into org/jboss/web/tomcat/session (under the deploy/jbossweb-tomcat50.sar directory). That prevents the error message I quoted, and allows Tomcat to display a few additional debug messages.

            Hope that's helpful to someone. Thanks, janilsal, for the pointer.