log4j log output problem in JBoss

Source: Internet
Author: User
Tags jboss log4j
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.