Currently Being Moderated

Logging

VERSION 49

Created on: Apr 14, 2004 11:24 PM by unknownMigrationUser - Last Modified:  May 9, 2008 9:15 AM by Darran Lofthouse

Logging with JBossAS

 

Refer to http://docs.jboss.org/process-guide/en/html/logging.html as well.

 

Log4j

The log4j configuration is loaded from the jboss server conf/log4j.xml file. (This file has been renamed to conf/jboss-log4j.xml in 4.2.)  You can edit this to add/change the default appenders and logging thresholds.

The following wiki entries will show how to alter your logging configuration file to accomplish different tasks.

 

 

Boot Logging

Note that during the boot process, logging is configured from $JBOSS_HOME/bin/run.jar. See JBossBootLogging for details

 

Logging Plug-in (JDK java.util.logging)

 

The choice of the actual logging implementation is determined by the org.jboss.logging.Logger.pluginClass system property. This property specifies the class name of an implementation of the org.jboss.logging.LoggerPlugin interface. The default value for this is the org.jboss.logging.Log4jLoggerPlugin class.

 

If you want to use the JDK 1.4+ java.util.logging framework instead of log4j, you can create your own Log4jLoggerPlugin to do this. The attached JDK14LoggerPlugin.java file shows an example implementation.

 

To use this, specify the following system properties:

 

  •      To specify the custom JDK1.4 plugin


      org.jboss.logging.Logger.pluginClass=logging.JDK14LoggerPlugin

 

  •      To specify the JDK1.4 logging configuration file


      java.util.logging.config.file=logging.properties

 

This can be done using the JAVA_OPTS env variable, for example:


JAVA_OPTS="-Dorg.jboss.logging.Logger.pluginClass=logging.JDK14LoggerPlugin 
           -Djava.util.logging.config.file=logging.properties" 

You need to make your custom Log4jLoggerPlugin available to JBoss by placing it in a jar in the JBOSS_DIST/lib directory, and then telling JBoss to load this as part of the bootstrap libraries by passing in -L jarname on the command line as follows:

 


$ run.sh -c minimal -L logger.jar

 

Referenced by:

 

 

 

Attachments:
Average User Rating
(0 ratings)




There are no comments on this article

More Like This

  • Retrieving data ...