tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Unckel" <boris.unckel....@gmx.net>
Subject Re: logging does not work in my webapp
Date Tue, 05 Sep 2006 09:31:35 GMT
Hello David,

my answers are inline:
-------- Original-Nachricht --------
Datum: Tue, 05 Sep 2006 10:46:07 +0200
Von: David Delbecq <delbd@oma.be>
An: users@tomcat.apache.org
Betreff: logging does not work in my webapp

> Hello,
> using tomcat, the logging does not work in my webapp. I am out of idea,
> so if someone can suggest me something more to test to get my logs.
> Here is the situation.
> I followed instructions on ow to setup tomcat for log4j (that is
> basically adds the commons-logging and log4j jars in common/lib)
I think you are referring to
http://tomcat.apache.org/tomcat-5.5-doc/logging.html
which assumes you are using Tomcat 5.5.
>From the text:
"Your web applications should certainly use their own log4j configuration. This is valid with
the above configuration. You would place a similar log4j.properties file in your web application's
WEB-INF/classes folder, and log4j1.2.8.jar into WEB-INF/lib. Then specify your package level
logging. This is a basic setup of log4j which does *not* require Commons-Logging, and you
should consult the log4j documentation for more options. This page is intended only as a bootstrapping
guide."

In other words:
Avoid to put commons-logging and log4j in commons/lib
and put everything in WEB-INF/lib.

Replace the default commons-logging-api.jar in TOMCAT_HOME/bin with the current version 1.1
and have a look at the diagnostic function
http://jakarta.apache.org/commons/logging/commons-logging-1.1/troubleshooting.html#Using_JCL_Diagnostics
Both jars (commons-logging-api.jar and commons-logging.jar should have the same version).

> I setup a log4j.xml file in my WEB-INF/classes/log4j.xml. I know it's
> read by log4j and used by commons-logging, because when i change the
> root debug level, it alters the verbosity of struts, bean utils, and so
> on. Setting up a org.apache category to reduce verbosity to info only
> does work too.
> 
> In my custom class i do this:
> 
>     private static Log log =
> LogFactory.getLog(SharkEngineBean.class.getName()); 
> /*be.dissco.shark.jsf.bean.SharkEngineBean*/
The use of a static Log is bad practise. Have a look at:
http://wiki.apache.org/jakarta-commons/Logging/StaticLog

Regards
Boris

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message