How do I enable DEBUG logging for category org.apache.catalina in the Tomcat distribution?

Adding the following category in $NUXEO_HOME/lib/log4j.xml does not seem to enable DEBUG logging for “org.apache.catalina” within the Tomcat Nuxeo Distribution. Does this category require special configuration?

1 votes

1 answers



Nope, normally this enough… You just have to restart your tomcat, normally. Check that there is no other child category of org.apache.catalina into your log4j.xml.

I am using the standard nuxeo 5.5 tomcat-based distribution and I have no other child categories of org.apache.catalina. DEBUG priority works fine for other categories. However, DEBUG priority seems to be ignored for org.apache.catalina.

Are you sure enabling org.apache.catalina debug logging via a standard $NUXEO_HOME/lib/log4j.xml modification works with a Nuxeo 5.5 Tomcat Distribution and causes these logging statements to be added to the normal nuxeo server.log? I am suspicious there might be conflicts between the in $NUXEO_HOME/conf and the log4j.xml in $NUXEO_HOME/lib.


$NUXEO_HOME/conf/ has no effect; you can safely remove it.

The point is Tomcat uses java.util.logging whereas Nuxeo uses Log4J.

Nuxeo provides a bridge for redirecting java.util.logging to Apache Commons Logging (compliant with Log4J) with a default threshold set at INFO level. You can customize it by adding into nuxeo.conf:

JAVA_OPTS=$JAVA_OPTS -Dorg.nuxeo.runtime.redirectJUL.threshold=DEBUG

Edit: the right corresponding JUL value for Log4J DEBUG level is

JAVA_OPTS=$JAVA_OPTS -Dorg.nuxeo.runtime.redirectJUL.threshold=CONFIG

But that redirection is only available after Nuxeo Framework initialization whereas most of the startup logs from org.apache.catalina happen before (when the redirection is not yet active).

So, if you want to see Catalina messages, you must also:

  • go on Tomcat 6 download page, then “Quick Navigation”, “Browse”, “bin”, “extras”
  • download tomcat-juli-adapters.jar into $NUXEO_HOME/lib/
  • download tomcat-juli.jar into $NUXEO_HOME/bin/ (replace the existing one)

At this point, the Log4J configuration will also apply on logs sent to java.util.logging; the category you added will work.

You may be interested by NXP-7014.

1 votes

Much thanks for the post! This is the exact information I was looking for.

Hello Julien, i tryed to add leading instruction in my nuxeo.conf, but server does not start, (bad level "DEBUG" error is logged). Also, if i change DEBUG with INFO server is starting up as expected.

The sample value was not good: DEBUG is a Log4J level, not valid for JUL. JUL levels are SEVERE, WARNING, INFO, CONFIG, FINE, FINER and FINEST.

Note the Nuxeo bridge will ignore FINER and FINEST which are too much verbose, FINE is mapped with TRACE and CONFIG with DEBUG.


Note: tomcat-juli* JARs are already included in the server since Nuxeo 5.7.2