You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Giovanni Azua <gi...@imc.nl> on 2008/04/24 13:54:54 UTC

RE: How to stop the verbose logging INFO in Struts 2.1.x

(I am posting this because I have been privately asked already couple of 
times)

Helping google: How do I stop the more verbose logging in Struts 2.1.x

For Tomcat users:

Struts 2 uses JCL i.e. Java Commons Logging which basically enables 
users plugging any existing concrete Logging implementation e.g. Log4J 
or Java JDK Logging. Therefore Struts 2 running in Tomcat (that also 
uses JCL) will inherit (Runtime class loading search see JCL) whatever 
logging implementation Tomcat was configured to use, by default Tomcat 
uses Java Logging.

Therefore in the default Tomcat installation and in order to avoid the 
many WARN logging coming from Struts 2.1.x you only need to modify the 
Tomcat configuration in:
$CATALINA_BASE/conf/logging.properties

changing the default category of INFO or WARN to a higher value e.g. 
SEVERE you will avoid all those WARN messages from Struts 2.

PLEASE NOTE:

In Tomcat versions before the latest 6.0.16 there seemed to be a bug in 
the $CATALINA_HOME/bin/catalina.sh
There was a mistake specifying the location of the logging 
configuration, that resulted in the default configuration being ignored 
in cases when CATALINA_HOME <> CATALINA_BASE. If you are stuck to 
whatever Tomcat version before 6.0.16 try looking for this snippet in 
catalina.sh and making sure that $CATALINA_BASE is the one used rather 
than $CATALINA_HOME (they might not be necessarily the same):

# Set juli LogManager if it is present
if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then
  JAVA_OPTS="$JAVA_OPTS 
"-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" 
"-Djava.util.logging.config.file="$CATALINA_BASE/conf/logging.properties"
fi
 
To non Tomcat users:

Try looking among the jars that are actually loaded by your Web Server 
whatever they are e.g. if you find log4j*.jar then you know you want to 
find that log4j.xml or log4j.properties and change the category there 
higher than WARN.

HTH,
regards,
Giovanni

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org