log4j log output problem in JBoss
Problem Description:
Applications use the LOG4J custom output debug Log, the debug-level application log cannot be exported after JBoss deployment.
problem Reason:
The JBoss used in Jboss-buildpack has a log4j module and the default output log level is info. When an application deployment is started in JBoss, JBoss takes precedence over the built-in log4j module, so the log4j custom log level in the application is below info and cannot be exported.
Solution:
If you want to use the LOG4J custom log level and output the debug log, you can use the following methods:
Add the file Jboss-deployment-structure.xml to the Web-inf directory where the war package is applied, and set up exclusions to block the LOG4J modules built into the JBoss system. Jboss-deployment-structure.xml contents are as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name= "org.apache.log4j"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
Modifying the JBoss default configuration file