I’m am having trouble logging using my appenders defined on my XML log4j configuration file.
I created the jboss-deployment-structure.xml on my EAR’s META-INF folder with no sucess.
The jboss-deployment-structure.xml structure is:
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<exclusions>
<module name="org.apache.log4j" slot="main"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
I have even tried to edit my standalone.conf.bat file adding the following line:
set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.as.logging.per-deployment=false"
My application deployment is like this:
-> MyAppEAR.ear
-> META-INF
-> MANIFEST.MF
-> MyAoo.war
-> META-INF
-> MANIFEST.MF
-> jboss-deployment-structure.xml
-> WEB-INF
-> web.xml
-> lib
-> log4j-1.2.17.jar
-> ---
-> classes
-> log4j.xml
-> ...
I’ve noticed the following error:
- jboss-deployment-structure.xml in subdeployment ignored. jboss-deployment-structure.xml is only parsed for top level deployments.
I even tried migrating from JBOSS 7.1.0 to 7.1.1
Some help please!
Thanks
Thanks for the repply James.
I did what you said and moved the jboss-deployment-structure.xml file to MyAppEAR.ear/META-INF.
I’ve noticed that this way the exception:
jboss-deployment-structure.xml in subdeployment ignored. jboss-deployment-structure.xml is only parsed for top level deployments.
… doesn’t occur. I don’t know if that means that the file was parsed… how can I tell?
Despite of this new behaviour my log4j.xml configuration file still isn’t loaded and the logger used still is Log4J’s.
I know this becaused I wrote to the console:
System.out.println(Logger.getRootLogger().getClass().toString())
…and got:
class org.jboss.logmanager.log4j.BridgeLogger
I’ve also tried:
- moving my log4j.xml to MyAppEAR.ear/META-INF.
- removing the unecessary -Dorg.jboss.as.logging.per-deployment=false from standalone.conf.bat
- removing slot from my jboss-deployment-structure.xml
Any more ideas?
Thanks
Hi RedEagle see the following configuration which i have tested and its working fine…
Step-1
Create a new module as
jboss-as-7.1.1.Final/modules/com/company/mylog/main/
Step-2
Now IN my.ear/META-INF/
content of jboss-deployment-structure.xml
Content of MANIFEST.MF
Step-3
Content of MyLogger.java
Step-4
Here is log4j.properties