Refer to http://docs.jboss.org/process-guide/en/html/logging.html as well.
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.
If you need to separate application logs
If you need to log to a separate server
If you need help with usage of logging levels
If you need information on key JBoss subsystem categories
If you need to redirect category output
If you need scoped logging configuration
If you need to use the JDK java.util.logging
If you need to trace System.out and System.err println calls
Note that during the boot process, logging is configured from $JBOSS_HOME/bin/run.jar. See JBossBootLogging for details
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:
There are no comments on this article