log4j

Configure multiple log4j instances in different contexts

The problem:
We needed to use different log4j.properties file for each context.

We have one library (directory.jar) which resides in tomcat's shared lib that uses log4j. We also have three contexts (core, admin & user contexts) that will be using log4j for logging too.

Initially, we put the log4j library in tomcat's shared lib, and specify log4j.properties for each context's web.xml. But we found out that only one context is able to initialize the log4j properly. The other two contexts doesn't seem to be able to use log4j properly.

Syndicate content