tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Issues Logging wtith log4j at common and webapp levels
Date Tue, 02 Oct 2012 22:17:27 GMT
On 02/10/2012 20:29, David Johle wrote:

Thanks for the clear question. While it was quite long, it was very
readable, relevant and on point. That meant I got to the end rather than
giving up after a few lines which is what usually happens with me and
long questions.

> So in summary, I'm just trying to get shared libraries to have their
> log4j-based logging written to the webapp-specific log files of the
> calling webapp.  Is this possible?  If so, what's the trick?

It can be done - with some caveats. Tomcat does this with Jasper.

The short version is:
- The loggers can not be static
- There must be an instance of the class per web-app.

If you have singletons and an instance per webapp doesn't make sense
then the only option that comes to mind (after not much thinking) is
that you need to pass the logger to the singleton rather than it using
its own.

HTH,

Mark


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


Mime
View raw message