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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to