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 10:35:07 GMT
Hi,

-------- Original-Nachricht --------
Datum: Tue, 05 Sep 2006 11:50:34 +0200
Von: David Delbecq <delbd@oma.be>
An: Tomcat Users List <users@tomcat.apache.org>
Betreff: Re: logging does not work in my webapp

> First, problem solved. It appear a 3rd party library include in my
> webapp was doing a manual configuration of log4j, resetting the root
> logger and sending logs to some file in the middle of nowhere.
OK, so something completely different.
> 
> Thanks for information. Am just curious, you tell me to put my
> commons-logging and log4j in my webapp (that's what i was doing before
> reading docs). However, if i read well the docs (tomcat 5.5) on
> classloader, the commons-logging in tomcat/bin will take precedence
> because it's a system class and as such can not be overwritten by the
> webapp ////$CATALINA_HOME/bin/commons-logging-api.jar is in system
> classloader. //
....
> 
> May the doc be wrong about it? could my commons-logging in webapp take
> precedence of the one in tomcat?
> //
> 
You are right, it is documented at
http://jakarta.apache.org/commons/logging/commons-logging-1.1/troubleshooting.html#Containers_With_Custom_ClassLoading_Behaviour_for_Logging
but JCL is classloader-aware, especially 1.1 has been closely tested into that direction.
If you have commons-logging-api.jar (1.1) in you TOMCAT_ROOT/bin and commons-logging.jar in
WEB-INF/lib and additionally the library of your choice (in your case: log4j) in WEB-INF/lib,
commons-logging will detect that and choose the correct library.
If you have it in commons/lib any webapp will use log4j with the configuration "found first"
(random) if there is more than one.

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