We have a j2ee web environment. The server is configured to share sessions and possibly classloaders in multiple web folders. Basically, a single class loader can serve multiple web applications.
This seems to be causing problems with log4j. Different webapps may have different log4j configurations, but the log will move to the same file.
Reading online, it looks like log4j uses singletons a lot in terms of additions and other features.
Is there a way to completely separate log4j configurations from one webapp from another.
Server: websphere6 +
log4j: 1.4.2
java: 1.5
Example log4j.properties (webapp1):
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/usr/local/file1.log
log4j.additivity.com.app=false
Example log4j.properties (webapp2):
log4j.appender.Z=org.apache.log4j.RollingFileAppender
log4j.appender.Z.File=/usr/local/file2.log
log4j.additivity.com.app=false
webapp2 webapp1 . .
:
? appender?
log4j. , logj4 webapp.