(Rodolfo) said:
>I need to configure log4j 1.2.8 with tomcat 4.1.30, I put my
>log4j.properties in "classes" directory but I obtain an error :
>
>log4j:WARN No appenders could be found for logger
>(org.apache.commons.digester.Digester).
>log4j:WARN Please initialize the log4j system properly.
>
>I think log4j.properties is correct because I have adapted it from an
>example, my doubt is about that is the place of the log4j.jar. I have
>put it in myapp/web-inf/lib and commons/lib. Is this place correct? Do
>I need to configure a system variable?
Unless you want to mess up with internal logging of Tomcat, avoid using
common/lib -- jars placed there are also visible to the Tomcat server
code (and as Tomcat uses the jakarta commons logging API, it'll use
log4j if it's accessible).
If you plan on running more than one webapp on this server instance,
I recommend placing the log4j and other jars common to all webapps
into shared/lib. Depending on your set-up, note that shared/lib is
rooted in CATALINA_BASE directory, whereas common/lib is rooted in
CATALINA_HOME. By default these are the same (where Tomcat is installed),
but the former can be set to point to a different location, to make
it easier to separate Tomcat distribution from the actual webapps.
If you want to force use of a log4j.properties file from somewhere
outside your webapp, you can add the following java system property
definition to your Tomcat startup:
-Dlog4j.configuration=file:/path/to/log4j.properties
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)