Hi,
I am using log4j in 2 wep apps running in the
Tomcat container. Instead of each app having its own copy of lo4j*.jar, I kept the jar file in $TOMCAT/shared/lib. The apps, however, had their own log4j config files.
I observed that my logging statements (from both web apps) are going in a single log file (the one which is configured for the app that is deployed most recently). It seems that the LoggerFactory instance is a singleton and its first log4j configuration is overwritten by the next one. Is that the case?
I have other libraries in $TOMCAT/shared/lib that depend on log4j. But I don't want to keep 3 copies of the jar file (2 for the web apps + 1 for shared/lib libraries) in Tomcat. Do I have an option?
Regards