cancel
Showing results for 
Search instead for 
Did you mean: 

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

ron_1
Star Contributor
Star Contributor

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 ACCEPTED ANSWER

Julien_Carsique
Elite Collaborator
Elite Collaborator

Hello,

$NUXEO_HOME/conf/logging.properties 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.

View answer in original post

8 REPLIES 8

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

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.

ron_1
Star Contributor
Star Contributor

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.

ron_1
Star Contributor
Star Contributor

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 logging.properties in $NUXEO_HOME/conf and the log4j.xml in $NUXEO_HOME/lib.

Julien_Carsique
Elite Collaborator
Elite Collaborator

Hello,

$NUXEO_HOME/conf/logging.properties 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.

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

Note

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.