ebxmlrr Logging Configuration

Currently, this document describes how logging should work rather than how it actually works. We want to useJakarta Commons Logging version 1.0 for all logging. Much code in ebxmlrr is not yet using the official logging interface and prints messages to stdout or stderr instead. Another issue is that some libraries used by ebxmlrr (particularly XML Security) override logging configurations.

Registry Server

TBD

Registry Browser

The registry browser is usually packaged in a JAR file and started with java -jar registry-browser.jar. When started, Commons Logging gets initialized. Commons Logging should find Log4J on the classpath and use it for the actual logging. Log4J reads its initialization information from the file log4j.properties that is packaged in the registry-browser.jar.

The best way of modifying the Log4J configuration is to change the file log4j.properties in registry-browser.jar. You may use a ZIP utility to remove the file from the Java archive and then add a new log4j.properties file with your own settings. Here is an example for a configuration file that writes all log messages to a file that is rolled over when it reaches a size of 10 MB:

log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=jaxr-ebxml.log
log4j.appender.R.MaxFileSize=1MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{ISO8601} %p %c[%t] - %m%n

One of the most interesting applications of Log4J is to restrict debug output only to certain packages or classes:

log4j.rootLogger=INFO, R
log4j.logger.com.sun.xml.registry=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=jaxr-ebxml.log
log4j.appender.R.MaxFileSize=1MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{ISO8601} %p %c[%t] - %m%n

For more information on configuring Log4J, see the manual.