Log4J your application server

We're looking into a solution using log4j to consolidate our logs in an third-party system using Application server and IBM has disabled the support for log4j in the application servers logging framework.

I tried to reverse this process and check what was needed to enable this feature again.

First of we need the log4j framework to load early in the startup. Adding it to the default classpath will enable this. This could be done by updating the systemlaunch.properties in %WAS_HOME%/plugins/com.ibm.ws.admin.core.jar/properties/systemlaunch.

Secondly you need to edit commons-logging.properties in %WAS_HOME%/plugins/com.ibm.ws.runtime.jar

Last but not least we need to add the Log4JLogger.class from commons-logging-1.1.3.jar (or atleast this was the one I tried and it's implementation do work with the Log interface) to %WAS_HOME%/plugins/com.ibm.ws.prereq.commons-logging.jar/org/apache/commons/logging/impl.

After these modifications has been done you just need a log4j.properties in your classpath.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.