Below are instructions for configuring the use of Log4j through the
Commons Logging wrapper in WebSphere v5.x.
(WebSphere v6.0.x instructions)
Add the log4j and commons logging JARs to the root of the EAR
project.
Add a properties directory to the root of the
EAR project.
Add your log4j.properties file to the properties
directory.
For each WAR project that needs logging, perform the following
steps.
Open the properties dialog.
Select Java JAR Dependencies.
Select the commons-logging and log4j libraries.
This much adds the JAR files to the classpath of the web app. But
we still need to add the properties directory. WSAD does
not permit adding this directly. Moreover, the format of this
entry is different for the WSAD test environment than it is for
WAS. So the next two entries must be added manually.
In the WSAD web project, navigate to the
WebContent/META-INF directory and edit the
MANIFEST.MF file.
Click the source tab. Add the two lines exactly as shown
below. The underscore character (_) indicates a blank space.