Usage of logging levels
JBoss/Log4j Level | JDK Logging Level | Description |
---|---|---|
FATAL | N/A | JBoss is likely to/will crash |
ERROR | SEVERE | A definite problem |
WARN | WARNING | Likely to be a problem, or it could be JBoss detected a problem it can recover from |
INFO | INFO | Lifecycle low volume, e.g. "Bound x into jndi", things that are of interest to a user |
DEBUG | FINE | Lifecycle low volume but not necessarily of interest to the user, e.g. "Starting listener thread" |
N/A | FINER | Medium volume detailed logging |
TRACE | FINEST | High volume detailed logging |
An log4j.xml example of restricting the org.jboss.resource category to WARN level messages is:
<category name="org.jboss.resource"> <priority value="WARN"></priority> </category>
The TRACE priority is a custom JBoss priority that requires an additional class attribute to specify the priority implementation class as shown here:
<!-- Show the evolution of the DataSource pool in the logs [inUse/Available/Max] --> <category name="org.jboss.resource.connectionmanager.JBossManagedConnectionPool"> <priority value="TRACE" class="org.jboss.logging.XLevel"></priority> </category>
Note for Appenders
Make sure that no "Threshold" has been set in the appender when setting logging level to TRACE, otherwise messages will not show up.
Note for JBoss Developers
Use of
org.jboss.logging.Logger.isDebugEnabled()
in code is deprecated, because DEBUG is for low volume logging; i.e. logging at debug level should occur infrequently enough that you don't need to check if the level is enabled. If a subsystem is logging too much info at debug level, that's a bug.
Referenced by:
Comments