16.2. Logging Configuration
Overview
etc/system.properties—the configuration file that sets the logging level during the container’s boot process. The file contains a single property, org.ops4j.pax.logging.DefaultServiceLog.level, that is set toERRORby default.org.ops4j.pax.logging—the PID used to configure the logging back end service. It sets the logging levels for all of the defined loggers and defines the appenders used to generate log output. It uses standard Log4j configuration. By default, it sets the root logger's level toINFOand defines two appenders: one for the console and one for the log file.NoteThe console's appender is disabled by default. To enable it, addlog4j.appender.stdout.append=trueto the configuration For example, to enable the console appender in a standalone container, you would use the following commands:JBossFuse:karaf@root>config:edit org.ops4j.pax.loggingJBossFuse:karaf@root>config:propappend log4j.appender.stdout.append trueJBossFuse:karaf@root>config:updateorg.apache.karaf.log.cfg—configures the output of the log console commands.
Changing the log levels
org.ops4j.pax.logging PID's log4j.rootLogger property so that the logging level is one of the following:
TRACEDEBUGINFOWARNERRORFATALOFF
Example 16.1. Changing Logging Levels
JBossFuse:karaf@root>config:edit org.ops4j.pax.loggingJBossFuse:karaf@root>config:propset log4j.rootLogger "DEBUG, out, osgi:VmLogAppender"JBossFuse:karaf@root>config:update
Changing the appenders' thresholds
log4j.appender.appenderName.threshold property that controls what level of messages are written to the appender. The appender threshold values are the same as the log level values.
DEBUG but limiting the information displayed on the console to WARN.
Example 16.2. Changing the Log Information Displayed on the Console
JBossFuse:karaf@root>config:edit org.ops4j.pax.loggingJBossFuse:karaf@root>config:propset log4j.rootLogger "DEBUG, out, osgi:VmLogAppender"JBossFuse:karaf@root>config:propappend log4j.appender.stdout.threshold WARNJBossFuse:karaf@root>config:update
Logging per bundle
sift appender to the Log4j root logger as shown in Example 16.3, “Enabling Per Bundle Logging”.
Example 16.3. Enabling Per Bundle Logging
JBossFuse:karaf@root>config:edit org.ops4j.pax.loggingJBossFuse:karaf@root>config:propset log4j.rootLogger "INFO, out, sift, osgi:VmLogAppender"JBossFuse:karaf@root>config:update
data/log/BundleName.log.
org.ops4j.pax.logging.cfg.
Logging History
~/.karaf/karaf.history. JBoss Fuse can be configured to prevent the history from being saved each time.
Procedure 16.1. Stop JBoss Fuse saving Logging History on shutdown.
- Stop JBoss Fuse.
- Edit
$FUSE_HOME/etc/system.properties. - Uncomment the line that says
# karaf.shell.history.maxSize = 0. - Restart JBoss Fuse
~/.karaf/karaf.history will still be created, but it will always have a size of 0, and will be empty.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.