I had this problem and it was solved in the following way:
use your own jar of log4j instead of the one provided by jboss. Do this by excluding org.apache.log4j jar module from the jboss application (exclude it in jboss-deployment-structure.xml) and add your own jar4j jar file to the lib folder of the .ear package. Now put log4j.xml in the root folder of your module.
By this method, you have full control over log4j (e.g. stand-alone applications).
Let me know if you still need help.
Example jboss-deployment-structure.xml for log4j.jar exception:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"> <deployment> <exclusions> <module name="org.apache.log4j" slot="main"/> </exclusions> </deployment> <sub-deployment name="MyEjb.jar"> <exclusions> <module name="org.apache.log4j"/> </exclusions> </sub-deployment>
source share