The first thing to be aware of is that log4j in JBoss 6.0 is broken, as is also the case in JBoss 6.1. The steps below are required to fix this and are based on clean JBoss 6.x AS installations.
1. Add and configure a log4j appenderThis is done by editing the jboss-logging.xml file located in the server deployment directory (jboss-6.x.0.Final/server/default/deploy)
First add an appender named "LOG4J" (or whatever you would like to call it):
<log4j-appender name="LOG4J" class="org.apache.log4j.FileAppender">
<pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/>
This configuration is for a standard log4j file appender writing to a file named "log4j.log".
Next you need to add your new appender to the root-logger section in the same file:
<!-- Set the root logger priority via a system property, with a default value. -->
If you were to start JBoss now it would be reasonable to expect a new log file named "log4j.log" to have been created in the server/default/log/ directory, unfortunately this is not the case. And instead you are given no errors by JBoss 6.0 while JBoss 6.1 spews the only slightly more useful message below for each line it should be writing to the log file:
ERROR [STDERR] log4j:ERROR No output stream or file set for the appender named [null].
2. Update log4j.jar packaged with JBoss installationDownload the latest version of the log4j 1.2 package from Apache log4j and replace the JBoss version in jboss-6.x.0/common/lib. Using 1.2.17:
cp apache-log4j-1.2.17/log4j-1.2.17.jar jboss-6.x.0.Final/common/lib/log4j.jar
3. Update the jboss-logging packagesDownload the patch (zip) from the bug report and unzip it. There is unfortunately no directory structure so you will need to manually copy the replacement JAR files as follows:
cp jboss-logmanager-log4j.jar jboss-6.x.0.Final/common/lib
cp jboss-logmanager.jar jboss-6.x.0.Final/lib
cp logging-service-metadata.jar jboss-6.x.0.Final/server/default/deployers/jboss-logging.deployer