Logging has been edited by Felix Meschberger (Apr 26, 2009).

(View changes)

Content:

Logging

Introduction

Logging in Sling is supported by the org.apache.sling.commons.log bundle, which is one of the first bundles installed and started by the Sling Launcher. The org.apache.sling.commons.log bundle has the following tasks:

Initial Configuration

The org.apache.sling.commons.log bundle gets the initial configuration from the following BundleContext properties:

Property Default Description
org.apache.sling.commons.log.level WARN Sets the initial logging level of the root logger. This may be any of the defined logging levels, which are by default DEBUG, INFO, WARN, ERROR and FATAL.
org.apache.sling.commons.log.file undefined Sets the log file to which log messages are written. If this property is empty or missing, log messages are written to System.out.
org.apache.sling.commons.log.file.number 5 The number of rotated files to keep.
org.apache.sling.commons.log.file.size 10M The maximum size in bytes of the log file before rotating it. This size may be specified with trailing multipliers: K or KB for kilo, M or MB for megabytes, and G or GB for gigabytes (case insensitive). Thus the default is 10 megabytes.
org.apache.sling.commons.log.pattern {0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5} The MessageFormat pattern to use for formatting log messages with the root logger.

User Configuration

User Configuration after initial configuration is provided by the Configuration Admin Service. To this avail two org.osgi.services.cm.ManagedServiceFactory services are registered under the PIDs org.apache.sling.commons.log.LogManager.factory.writer and org.apache.sling.commons.log.LogManager.factory.config which may receive configuration.

TODO: Expand on this configuration

Reply via email to