tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim" <>
Subject Tomcat can't find log4j properties file in war file
Date Wed, 21 Jan 2004 03:04:10 GMT
I have a web app served by Tomcat on a Unix system which I have been running
out the development environment.  I am trying to deploy it as a jar file.
When the log4j logging system starts up it says it cannot find the
properties file in the war file.

Do I have to specify the properties file location differently?

More detailed information is below.
Any suggestions will be greatly appreciated; I thank you in advance for your

Jim Cant

At startup, Tomcat loads a servlet to initialize the log4j logging system;
the name of an initialization file is given in the servlet element in the
web.xml file:
The log file is located in the directory 'docBase' in server.xml, specified
with an absolute path:
           <Context path="/HSP" docBase="/home/jcant/HSP/WebApp" .....
This works fine and logging gets initialized.

However, when I jar up the development into HSP.war and point Tomcat at it,
the properties file is not found.
I change server.xml so docBase="HSP.war" and also set 'appbase' to point to

When Tomcat is restarted, the web app runs fine out of the war file but the
logging never gets initialized.  The log file has the error message
                  log4j:ERROR Could not read configuration file
such file or directory)
The properties file is in the root of the war file which is the
corresponding place to the 'WebApp' directory when running from the
development environment.

When I look in $TOMCAT_HOME/work/Standalone/localhost/HSP, I see the WEB-INF
directory and subdirectories has been deployed but no other files in the war
file are there.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message