Search code examples
logginglog4jjboss-eap-6

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.


Solution

  • JBoss EAP 6.x does not use log4j. It uses JBoss Log Manager which is an extension of J.U.L.

    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.