简体   繁体   中英

Customizing JBOSS 6.2 EAP logging

Developing a web application using JBOSS 6.2 EAP as the Application server. Trying to customize the the logging. Want to create different logs for different modules in specified locations.

Did some home work and tried to add

periodic-rotating-file-handler name="FOO_BAR_FILE">
    <formatter>
        <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
    </formatter>
    <file relative-to="jboss.server.log.dir" path="foo_bar_file.log"/>
    <suffix value=".yyyy-MM-dd"/>
    <append value="true"/>
</periodic-rotating-file-handler>

in the profile section of standalone.xml

and added the logger also in the same file

<logger category="com..org.Commets">
    <level name="INFO"/>
    <handlers>
        <handler name="FOO_BAR_FILE"/>
    </handlers>
</logger>

Also, cant able to find the log4j.xml in the jboss folder. New to JBoss , guess missing something or going in the wrong way. Can somebody help in this.

JBoss EAP 6.x does not use log4j. It uses JBoss Log Manager which is an extension of JUL

With regards to your configuration what you have should work just fine. Assuming of course you have a category named com..org.Comments .

If you want each deployment to have their own logging configuration have a look at per-deployment logging or logging profiles .

If you are trying to configure logging in JBoss and not in the deployment descriptor of the application you are deploying, then I think you will also need to set the host property org.jboss.as.logging.per-deployment=false. This tells JBoss to use the server logging config and not the application logging config.

And I think JBoss does support Log4J, at least according to page 340 of the following JBoss Admin Doc: Administration and Configuration Guide

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM