0 Replies Latest reply on Apr 24, 2003 6:45 PM by Brian Stansberry

    Trace logging from Tomcat

    Brian Stansberry Newbie

      While debugging an issue, I spent quite a bit of time trying to figure out how to get voluminous logging from JBoss' embedded Tomcat server, and thought I would pass on what I learned.

      Cutting to the chase, for JBoss 3.0.x at least, add the following to your conf/lo4gj.xml file...





      Standard standalone Tomcat configures logging by letting you set "debug='someNumber'" attributes on a number of the elements in their server.xml config file. debug='0' gives you minimal logging; debug='2' gives you a ton. But, adding those attributes to the tomcat config section of JBoss' tomcat41-service.xml does not work.

      Turns out that the JBoss class that controls the embedded Tomcat (currently org.jboss.web.catalina.EmbeddedCatalinaService41) sets Tomcat's logging level based on it's own level. If it's running at XPriority.TRACE level, it sets Tomcat to '2'; otherwise it sets Tomcat to '0'. The above Log4j config snippet will get you debug=2 logging from the Tomcat classes.

      Best,
      Brian