log4j with multiple apps in WebSphere
Posted on 2014-04-16
I'm deploying an application in WebSphere on a server with other applications already deployed. I have log4j configured in a log4j.xml that is under WEB-INF/classes in the war and is deployed correctly on the server. I'm using a RollingFileAppender that designates a log file and DEBUG level output. In local testing, the log file is created and DEBUG level statements are written to it.
Under WebSphere, all log4j output goes to SystemOut.log, and only INFO level output is written. I've studied the other deployed applications, and one of the others has the same result as my application - output at INFO level only going to SystemOut.log. Only one application seems to be able to create the log file designated in its log4j.xml and get the desired output level.
I've tried to explicitly initialize log4j but it has no effect. The server has a "Multiple" classloader policy with "parent class loader first".
So my question is whether anyone knows if this is a WebSphere limitation that only allows one log4j configuration per server. Or am I just missing a step.