rob rowntree
Fri, 19 Dec 2003 18:45:14 -0800
I had a demo this week using a WAR file that i deployed many times on Windows with great results. This week using the same WAR file on Linux for the first time, EVERY LOGGER Call threw an exception $%^#& not my best week for demos.
some hypothesis follows and i would greatly appreciate expert guidance on
this...
Note that jar "log4j-1.2.8.jar" contains PropertyConfigurator.class and that
this jar is in the following 2 WebApp directories under Tomcat/BASE...
NOTE ALSO that NONE of the Tomcat Common, shared, endorsed libs contain
log4j-1.2.8.jar.
#1
[EMAIL PROTECTED] /cygdrive/g/jakarta-tomcat-5.0.16
$ find -name log4j-1.2.8.jar
./webapps/axis/WEB-INF/lib/log4j-1.2.8.jar
./webapps/ftp-examples/WEB-INF/lib/log4j-1.2.8.jar
---------------------
static code for log4j configuration that i use in every class...
#2
static
{
log = Logger.getLogger((this.class).getName());
PropertyConfigurator.configure(
this.class.getClassLoader()
.getResource(
"config/log4j.properties"
)
);
}
----- log4j.properties file (elided) -----
#3
# LOGFILE is set to be a File appender using a PatternLayout.
#log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.LOGFILE.File=logs/ftp.log <-- linux exception on this
<-- "File does NOT EXIST"
----- Behavior of War deployed on Windows...
NOTE that the code at #2 operates in a Web app. and will load
PropertyConfigurator class from the jar located at that webapp's context (
webapps/this.context/WEB-INF/lib/log4j-1.2.8.jar ).
However, in Windows, the crazy feature is that the fileAppender from #3 gets
written NOT at the Webapp's context , but a Tomcat's BASE as in
"G:\jakarta-tomcat-5.0.16\logs". This seem's impossible to me??
------- Behavior of War deployed on Linux...
every log.debug() call throws a "file does not exist" ( logs/ftp.log )
exception. Why is this? Like on Windows example above, here the Linux path
"jakarta-tomcat-5.0.16/logs" exists but the system never writes the appender
there.
Its as if on Linux, the only place it will try to write the appender is to:
webapps/this.context/logs/ftp.log and since there is no "logs" directory
under each
web context, the error is thrown...
Since the WAR file does not define a path under every WEBAPP that includes
"this.context/logs" , all the logger calls throw exceptions...
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]