The FUSE ESB runtime uses log4j as its logging mechanism. Using standard log4j configuration you can customize everything from the logging levels reported by the different runtime components to the format used when publishing the log messages.
The log4j configuration is specified in the etc/org.ops4j.pax.logging.cfg
configuration file. The default
configuration sets the root logger's level to INFO
and the level of most of the child loggers to WARN
or
ERROR
. The default configuration defines two appenders. One for the console and one for the log file. The console's
appender's threshold is set to INFO
and the file appender's threshold is set to DEBUG
.
![]() | Important |
---|---|
FUSE ESB only supports the Java properties format of the log4j configuration. |
In addition, you can set the logging level for the underlying OSGi framework. This is done by editing a property in the
etc/config.properties
configuration file.
Table 4.1 lists the configured loggers and their default logging level.
Table 4.1. Loggers
Logger | Level |
---|---|
root | INFO |
org.apache | WARN |
org.springframework | WARN |
org.jenks | WARN |
org.apache.activemq | WARN |
org.apache.activemq.transport.discovery | ERROR |
org.apache.servicemix | INFO |
org.apache.servicemix.jbi.config | WARN |
org.apache.servicemix.jbi.deployment | WARN |
The default logging configuration sets the logging levels so that the log file will provide enough information to monitor the behavior of the runtime and provide clues about what caused a problem. However, the default configuration will not provide enough information to debug most problems.
The most useful logger to change when trying to debug an issue with FUSE ESB is the root logger. You will want to set its logging level
to DEBUG
as shown in Example 4.1.
Example 4.1. Changing Logging Levels
# Root logger log4j.rootLogger=DEBUG, out, osgi:VmLogAppender ...
When debugging a problem in FUSE ESB you may want to change the level of logging information that is displayed on the console.
Example 4.2 shows an example of setting the root logger to DEBUG
but
limiting the information displayed on the console to WARN
.
Example 4.2. Changing the Log Information Displayed on the Console
log4j.rootLogger=DEBUG, stdout, osgi:VmLogAppender
...
log4j.appender.stdout.threshold=WARN
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n
...
The logging level of the underlying OSGi framework is controlled by the felix.log.level property in the
etc/config.properties
configuration file. The property can be set to a number between 0
and
4
. The levels match the log levels specified in the OSGi Log Service:
Value | Log Level |
---|---|
0 | None |
1 (default) | Error |
2 | Warning |
3 | Information |
4 | Debug |
For more information on configuring log4j see the log4j manual.