JBoss Community

JBoss AS7 Logging

modified by Anil Saldhana in JBoss AS7 Development - View the full document

This article describes the logging configuration starting JBoss AS v7.0.0.  The article should be updated periodically with any changes that have happened to logging (and note the version where the change occurred).

Boot Logging

This is the boot.log that you see.  Its configuration is in the logging.properties.

 

 

Server Logging

The configuration should be done in the standalone.xml for the standalone distribution.  Basically the configuration now is done in the domain model. So it is either domain.xml or standalone.xml depending on the type of distribution.

 

The log output will go into server.log

 

Deployment Level Logging

This is when you want to have your own JDK or Log4J logging driven at the deployment level.  This feature needs to be implemented by https://issues.jboss.org/browse/JBAS-9084

 

How do I?

 

Suppose you want to enable trace level logging on org.jboss.security,  this is how the standalone.xml block looks:

 

 <subsystem xmlns="urn:jboss:domain:logging:1.0">
            <console-handler name="CONSOLE" autoflush="true">
                <level name="INFO"/>
                <formatter>
                    <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                </formatter>
            </console-handler>
            <periodic-rotating-file-handler name="FILE" autoflush="true">
                <level name="TRACE"/>
                <formatter>
                    <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                </formatter>
                <file relative-to="jboss.server.log.dir" path="server.log"/>
                <suffix value=".yyyy-MM-dd"/>
            </periodic-rotating-file-handler>
            <logger category="com.arjuna">
                <level name="WARN"/>
            </logger>
            <logger category="org.apache.tomcat.util.modeler">
                <level name="WARN"/>
            </logger>
            <logger category="sun.rmi">
                <level name="WARN"/>
            </logger> 
            <logger category="org.jboss.security">
                <level name="TRACE"/>
            </logger>

 

Note that I added a logger block for "org.jboss.security".  Now I need to also change the level for the appender -either CONSOLE or FILE. In most cases, you want to do it for FILE.  Now enjoy the trace entries.

Comment by going to Community

Create a new document in JBoss AS7 Development at Community