Log4j setup

2003-11-18 Thread Bender, Christopher
Im using tomcat to house a few servlets.  These servlets are under 
webapps/myServ/WEB_INF/classes.  What these servlets are, are a web-interface around 
another java app that I have located somewhere on my drive (/home/myOtherApp/ for 
instance).

I also have a common library of middleware tools that I use in both the servlets and 
the app.  This middleware uses log4j to write debug messages to the console as well as 
a rolling file.  

The java app being called by the servlets is actually wrapped in an ant build file and 
is executed through Ant programatic (java) calls.  All the calsspath setup is done in 
this buildfile.

The problem I am having is getting log4j to work within my servlets.  When I place 
log4j.jar in the directory where my app is looking for jars, everything works fine and 
I get log4j messages.  Unfortunatly, my servlets also need log4j (since they are using 
the middleware which is full of log4j) so i placed a copy of the jar in 
webapps/myServ/WEB_INF/lib.  When I do this though log4j doesnt work and I get various 
error messages saying I cant intitialize my appenders, etc, etc.

Im not sure if anyone will have a solution but maybe some ideas can get me going down 
the right path.


Thanks everyone,
Chris

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Log4j setup

2003-11-18 Thread Andreas Mohrig
Hi Chris,

this is probably a classloader issue, and those puzzle me most of the time,
too. Try placing an additional log4j.properties file into your
webapps/myServ/WEB_INF/classes directory (duplicating your original one).
Specifying the location of your log4j.properties file on the commandline to
java when starting tomcat could be an option, too (but I have not tried
this). The command-line argument seems to be
-Dlog4j.configuration=PATH_TO_YOUR_FILE

Greetings

Andreas Mohrig

-Original Message-
From: Bender, Christopher [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 3:24 PM
To: [EMAIL PROTECTED]
Subject: Log4j setup


Im using tomcat to house a few servlets.  These servlets are under
webapps/myServ/WEB_INF/classes.  What these servlets are, are a
web-interface around another java app that I have located somewhere on my
drive (/home/myOtherApp/ for instance).

I also have a common library of middleware tools that I use in both the
servlets and the app.  This middleware uses log4j to write debug messages to
the console as well as a rolling file.  

The java app being called by the servlets is actually wrapped in an ant
build file and is executed through Ant programatic (java) calls.  All the
calsspath setup is done in this buildfile.

The problem I am having is getting log4j to work within my servlets.  When I
place log4j.jar in the directory where my app is looking for jars,
everything works fine and I get log4j messages.  Unfortunatly, my servlets
also need log4j (since they are using the middleware which is full of log4j)
so i placed a copy of the jar in webapps/myServ/WEB_INF/lib.  When I do this
though log4j doesnt work and I get various error messages saying I cant
intitialize my appenders, etc, etc.

Im not sure if anyone will have a solution but maybe some ideas can get me
going down the right path.


Thanks everyone,
Chris

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]