I am migrating an EAR application from JBoss 6.1.0 AS to Wildfly 8.2.0 AS. EAR contains log4j.xml and application logs are generated by using this logging configuration file by employing the below line of code:
org.apache.log4j.xml.DOMConfigurator.configureAndWatch(log4j file path)
Application logs are generated fine but in server.log, application logs are also getting appended. I am using standalone-full-ha.xml configuration file and tried the below steps:
- Added jboss-deployment-structure.xml with the following contents:
<deployment>
<exclude-subsystems>
<subsystem name="logging" />
</exclude-subsystems>
</deployment>
- Added below lines under
<subsystem xmlns="urn:jboss:domain:logging:2.0">
section
in standalone-full-ha.xml.
<use-deployment-logging-config value="true"/>
<add-logging-api-dependencies value="false"/>
How can I prevent applications logs getting appended in server.log ? Please help.
Workaround tried
Just adding to my previous comments, I tried first option provided in the link http://www.mastertheboss.com/jboss-server/jboss-log/using-log4j-with-jboss-as-7-and-wildfly.
Added log4j.xml under META-INF of EAR.
Added org.apache.log4j module as one of the dependencies attribute in MANIFEST.MF.
It was mentioned to add a VM argument -Dorg.jboss.as.logging.per-deployment=true but I did not add.
server.log is generated fine and application logs are getting generated fine but I have below concerns:
is the starting tag in log4j.xml and it has "warn" as value of threshold attribute. But, I am getting all kind of logs (i.e. works as ALL or DEBUG threshold).
I have placed log4j.xml in META-INF of EAR. So, will org.apache.log4j.xml.DOMConfigurator.configureAndWatch(log4j file path) work where path denotes log4j.xml in META-INF ? Default time out is 60 seconds and if I change threshold, will it reflect ?