> From: Joe Hansen [mailto:joe.hansen...@gmail.com]
> Subject: Re: Log4j logging doesn't work when a web application is moved
> outside Tomcat/webapps directory
> 
> Initially I placed log4j-1.2.15.jar in the c:\Tomcat\lib 
> directory only. This resulted in abc webapp logging in the
> c:\Tomcat\logs\xyz.log file.

As expected - first one in wins.

> When I copied the log4j-1.2.15.jar to
> c:\Tomcat\webapps-abc\ROOT\WEB-INF\lib and
> c:\Tomcat\webapps-xyz\ROOT\WEB-INF\lib directories, it
> created empty abc.log and xyz.log files.

That's a least a good start - the separate appenders created the desired files. 
 One presumes you expected the files to actually have something in them...

> When I delete c:\Tomcat\lib\log4j-1.2.15.jar, I get Tomcat startup
> errors (NoClassDefFoundError: org/apache/log4j/Category).

Let's see the complete stack trace for that error.

Do you have other classes in Tomcat's lib directory that are shared by the 
webapps, and do those classes attempt to do logging?  Unless you really need 
them to be shared, put those classes in each webapp's WEB-INF/lib or 
WEB-INF/classes directories.  Otherwise, you'll need to modify your code and 
have each webapp pass in or otherwise expose its logger to the methods of the 
common classes.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to