Hi,

Hope someone can advise.

We have an unconventional deployment of our applications in Tomcat (4.1.x) where, 
rather than deploying classes under each webapp, they have been deployed together in a 
jar under CATALINA_BASE/shared/lib alongside other library jars. We do this to ease 
deployment as we have a large number of classes that are common across many 
applications.

This may not be the 'correct' way to deploy them but that is how it is, the 
applications work and it would be a large amount of work to reorganise.

We are considering using log4j to provide logging for these apps. but it seems to me 
that our unconventional deployment makes this difficult.

Please correct me if I am wrong, but in a normal deployment the application classes, 
log4j.jar and the log4j.configuration are all deployed under the webapp allowing 
control over the logging for that specific application.

In our setup, we have lost the possiblity of control the logging on a per application 
basis from the configuration file. The only option we would have there is to set 
different logging levels and/or appenders to different points in the class/package 
hierarchy. However this wouldn't provide much benefit to us as many classes are used 
by more than one application.

As I see it, the only way around this is for us to use an MDC in each of our Servlets 
to identify the application it belongs to, have the Pattern print this value out and 
write a custom appender (or some filtering later on) to separate the log entries for 
each application based on this value.

If anyone has any experience with logging classes from CATALINA_BASE/shared/lib I'd 
appreciate it. I wonder if I have missed an easy trick and am making things too 
complicated.

Also, as in this situation, I have log4j.jar also in CATALINA_BASE/shared/lib, where 
should I put the log4j.configuration file for it to be picked up automatically?

Thanks,
D.


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

Reply via email to