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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s