This is trivial if you only introduce log4j.jar in each web app.

If you share log4j.jar across web apps, then you have some LoggerRepositorySelector coding ahead of you. This is easy enough via JNDI context for cases where the contextual classloader is set for you by Tomcat, but in other cases (e.g. JMX remote request threads) you have to do such classloader setup yourself.

Our web app now supports a per context log4j even if log4j.jar is shared -- in which case anything outside all the web apps goes into another log4j context.

Note the log4j JMX MBeans don't support this sort of thing properly (they have a hard-wired ObjectName location for starters), so you'll have to write your own if you're interested in that aspect.

Oded Arbel wrote:
Guys, how can I setup log4j with a context specific configuration file ? In the past I used to put a global log4j configuration in the system classpath for the tomcat, but that is no longer appropriate in my current setup.

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

Reply via email to