Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 384E210F96 for ; Sun, 17 Nov 2013 14:57:22 +0000 (UTC) Received: (qmail 76413 invoked by uid 500); 17 Nov 2013 14:57:20 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 76348 invoked by uid 500); 17 Nov 2013 14:57:20 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 76341 invoked by uid 99); 17 Nov 2013 14:57:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Nov 2013 14:57:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Nov 2013 14:57:12 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 592A62388B42 for ; Sun, 17 Nov 2013 14:56:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r886968 - in /websites/staging/sling/trunk/content: ./ documentation/development/logging-new.html documentation/development/logging.html documentation/legacy/ documentation/legacy/logging.html sitemap.html Date: Sun, 17 Nov 2013 14:56:49 -0000 To: commits@sling.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131117145649.592A62388B42@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Sun Nov 17 14:56:48 2013 New Revision: 886968 Log: Staging update by buildbot for sling Added: websites/staging/sling/trunk/content/documentation/legacy/ websites/staging/sling/trunk/content/documentation/legacy/logging.html Removed: websites/staging/sling/trunk/content/documentation/development/logging-new.html Modified: websites/staging/sling/trunk/content/ (props changed) websites/staging/sling/trunk/content/documentation/development/logging.html websites/staging/sling/trunk/content/sitemap.html Propchange: websites/staging/sling/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Sun Nov 17 14:56:48 2013 @@ -1 +1 @@ -1542740 +1542742 Modified: websites/staging/sling/trunk/content/documentation/development/logging.html ============================================================================== --- websites/staging/sling/trunk/content/documentation/development/logging.html (original) +++ websites/staging/sling/trunk/content/documentation/development/logging.html Sun Nov 17 14:56:48 2013 @@ -85,18 +85,29 @@

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:

+
+Work in progress as part of SLING-3070 +
+ +
+This document is for new 4.x release of Sling Commons Log components. Refer to +[Logging](http://sling.apache.org/documentation/legacy/logging.html) for documentation related +to older version. +
+ +

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. This bundle along with other bundles manage the Sling Logging and provide following +features

  • Implements the OSGi Log Service Specification and registers the LogService and LogReader services
  • -
  • Exports three commonly used logging APIs: -
  • -
  • Configures logging through our own implementation of the SLF4J backend API
  • +
  • java.util.logging
  • +
  • Configures logging through Logback which is integrated with the OSGi environment
  • +
  • Logging can be configured both via editing Logback xml or via OSGi Configurations

Initial Configuration

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

@@ -139,12 +150,21 @@ n/a Enables the java.util.logging support. + +org.apache.sling.commons.log.configurationFile +n/a +Path for the Logback config file which would be used to configure logging. If the path is not absolute then it would be resolved against Sling Home + -

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.

+

User Configuration - OSGi Based

+

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.

Logger Configuration

-

Loggers (or Categories) can be configured to log to specific files at specific levels using configurable patterns. To this avail factory configuration instances with factory PID org.apache.sling.commons.log.LogManager.factory.config may be created and configured with the Configuration Admin Service.

+

Loggers (or Categories) can be configured to log to specific files at specific levels using configurable patterns. +To this avail factory configuration instances with factory PID org.apache.sling.commons.log.LogManager.factory.config +may be created and configured with the Configuration Admin Service.

The following properties may be set:

@@ -182,7 +202,9 @@
-

Note that multiple Logger Configurations may refer to the same Log Writer Configuration. If no Log Writer Configuration exists whose file name matches the file name set on the Logger Configuration an implicit Log Writer Configuration with default setup (daily log rotation) is internally created.

+

Note that multiple Logger Configurations may refer to the same Log Writer Configuration. If no Log Writer Configuration +exists whose file name matches the file name set on the Logger Configuration an implicit Log Writer Configuration +with default setup (daily log rotation) is internally created.

Log Writer Configuration

Log Writer Configuration is used to setup file output and log file rotation characteristics for log writers used by the Loggers.

The following properties may be set:

@@ -212,13 +234,24 @@ -

See the section Log File Rotation below for full details on the org.apache.sling.commons.log.file.size and org.apache.sling.commons.log.file.number properties.

-

Log File Rotation

-

Log files can grow rather quickly and fill up available disk space. To cope with this growth log files may be rotated in two ways: At specific times or when the log file reaches a configurable size. The first method is called Scheduled Rotation and is used by specifying a SimpleDateFormat pattern as the log file "size". The second method is called Size Rotation and is used by setting a maximum file size as the log file size.

-

As of version 2.0.6 of the Sling Commons Log bundle, the default value for log file scheduling is '.'yyyy-MM-dd causing daily log rotation. Previously log rotation defaulted to a 10MB file size limit.

-

Scheduled Rotation

-

The rolling schedule is specified by setting the org.apache.sling.commons.log.file.size property to a java.text.SimpleDateFormat pattern. Literal text (such as a leading dot) to be included must be enclosed within a pair of single quotes. A formatted version of the date pattern is used as the suffix for the rolled file name.

-

For example, if the log file is configured as /foo/bar.log and the pattern set to '.'yyyy-MM-dd, on 2001-02-16 at midnight, the logging file /foo/bar.log will be renamed to /foo/bar.log.2001-02-16 and logging for 2001-02-17 will continue in a new /foo/bar.log file until it rolls over the next day.

+

See the section Log File Rotation below for full details on the org.apache.sling.commons.log.file.size and +org.apache.sling.commons.log.file.number properties.

+

Log File Rotation

+

Log files can grow rather quickly and fill up available disk space. To cope with this growth log files may be rotated in +two ways: At specific times or when the log file reaches a configurable size. The first method is called Scheduled Rotation +and is used by specifying a SimpleDateFormat pattern as the log file "size". The second method is called Size Rotation +and is used by setting a maximum file size as the log file size.

+

As of version 2.0.6 of the Sling Commons Log bundle, the default value for log file scheduling is '.'yyyy-MM-dd +causing daily log rotation. Previously log rotation defaulted to a 10MB file size limit.

+
Scheduled Rotation
+

The rolling schedule is specified by setting the org.apache.sling.commons.log.file.size property to a +java.text.SimpleDateFormat pattern. Literal text (such as a leading dot) to be included must be enclosed within a +pair of single quotes. A formatted version of the date pattern is used as the suffix for the rolled file name. Internally +the Log bundle configures a TimeBasedRollingPolicy for the appender. Refer to TimeBasedRollingPolicy for +more details around the pattern format

+

For example, if the log file is configured as /foo/bar.log and the pattern set to '.'yyyy-MM-dd, on +2001-02-16 at midnight, the logging file /foo/bar.log will be renamed to /foo/bar.log.2001-02-16 and logging for +2001-02-17 will continue in a new /foo/bar.log file until it rolls over the next day.

It is possible to specify monthly, weekly, half-daily, daily, hourly, or minutely rollover schedules.

@@ -261,13 +294,209 @@
-

Do not use the colon ":" character in anywhere in the pattern option. The text before the colon is interpeted as the protocol specificaion of a URL which is probably not what you want.

-

Note that Scheduled Rotation ignores the org.apache.sling.commons.log.file.number property since the old log files are not numbered but "dated".

-

Size Rotation

-

Log file rotation by size is specified by setting the org.apache.sling.commons.log.file.size property to a plain number or a number plus a size multiplier. The size multiplier may be any of K, KB, M, MB, G, or GB where the case is ignored and the meaning is probably obvious.

-

When using Size Rotation, the org.apache.sling.commons.log.file.number defines the number of old log file generations to keep. For example to keep 5 old log files indexed by 0 through 4, set the org.apache.sling.commons.log.file.number to 5 (which happens to be the default).

+

Do not use the colon ":" character in anywhere in the pattern option. The text before the colon is interpreted as the +protocol specification of a URL which is probably not what you want.

+

Note that Scheduled Rotation ignores the org.apache.sling.commons.log.file.number property since the old log files are +not numbered but "dated".

+
Size Rotation
+

Log file rotation by size is specified by setting the org.apache.sling.commons.log.file.size property to a plain number +or a number plus a size multiplier. The size multiplier may be any of K, KB, M, MB, G, or GB where the case +is ignored and the meaning is probably obvious.

+

When using Size Rotation, the org.apache.sling.commons.log.file.number defines the number of old log file generations +to keep. For example to keep 5 old log files indexed by 0 through 4, set the org.apache.sling.commons.log.file.number +to 5 (which happens to be the default).

+

Logback Integration

+

Logback integration provides following features

+
    +
  • LogBack configuration can be provided via Logback config xml
  • +
  • Supports Appenders registered as OSGi Services
  • +
  • Supports Filters and TurboFilters registered as OSGi Services
  • +
  • Support providing Logback config as fragments through OSGi Service Registry
  • +
  • Support for referring to Appenders registered as OSGi services from with Logback + config
  • +
  • Exposing Logback runtime state through Felix WebConsole Plugin
  • +
+

Following sections would provide more details around these features

+

TurboFilters as OSGi Service

+

Logback TurboFilter operate globally and invoked for every Logback call. To register a TurboFilter as OSGi service +the bundle just need to register a service against ch.qos.logback.classic.turbo.TurboFilter class

+
import import ch.qos.logback.classic.turbo.MatchingFilter;
+
+SimpleTurboFilter stf = new SimpleTurboFilter();
+ServiceRegistration sr  = bundleContext.registerService(TurboFilter.class.getName(), stf, null);
+
+private static class SimpleTurboFilter extends MatchingFilter {
+    @Override
+    public FilterReply decide(Marker marker, Logger logger, Level level, String format,
+     Object[] params, Throwable t) {
+        if(logger.getName().equals("turbofilter.foo.bar")){
+                return FilterReply.DENY;
+        }
+        return FilterReply.NEUTRAL;
+    }
+}
+
+ + +

As these filters are invoked for every call they must not take much time to execute.

+

Filter as OSGi service

+

Logback Filters are attached to appenders and are used to determine if any LoggingEvent needs to +be passed to the appender. When registering a filter the bundle needs to configure a service property +appenders which refers to list of appender names to which the Filter must be attached

+
import ch.qos.logback.core.filter.Filter;
+
+SimpleFilter stf = new SimpleFilter();
+Dictionary<String, Object> props = new Hashtable<String, Object>();
+props.put("appenders", "TestAppender");
+ServiceRegistration sr  = bundleContext.registerService(Filter.class.getName(), stf, props);
+
+private static class SimpleFilter extends Filter<ILoggingEvent> {
+
+    @Override
+    public FilterReply decide(ILoggingEvent event) {
+        if(event.getLoggerName().equals("filter.foo.bar")){
+            return FilterReply.DENY;
+        }
+        return FilterReply.NEUTRAL;
+    }
+}
+
+ + +

Appenders as OSGi service

+

Logback Appenders handle the logging events produced by Logback. To register an Appender as OSGi service +the bundle just need to register a service against ch.qos.logback.core.Appender class. When registering an +appender the bundle needs to configure a service property loggers which refers to list of logger names to which +the Appender must be attached

+
Dictionary<String,Object> props = new Hashtable<String, Object>();
+
+String[] loggers = {
+        "foo.bar:DEBUG",
+        "foo.bar.zoo:INFO",
+};
+
+props.put("loggers",loggers);
+sr = bundleContext.registerService(Appender.class.getName(),this,props);
+
+ + +

Logback Config Fragment Support

+

Logback supports including parts of a configuration file from another file (See File Inclusion). This module +extends that support by allowing other bundles to provide config fragments. There are two ways to achieve that

+

Exposing fragment as String objects

+

If you have the config as string then you can register that String instance as a service with property logbackConfig +set to true. Sling Logback Extension would monitor such objects and pass them to logback

+
Properties props = new Properties();
+props.setProperty("logbackConfig","true");
+
+String config = "<included>\n" +
+        "  <appender name=\"FOOFILE\" class=\"ch.qos.logback.core.FileAppender\">\n" +
+        "    <file>${sling.home}/logs/foo.log</file>\n" +
+        "    <encoder>\n" +
+        "      <pattern>%d %-5level %logger{35} - %msg %n</pattern>\n" +
+        "    </encoder>\n" +
+        "  </appender>\n" +
+        "\n" +
+        "  <logger name=\"foo.bar.include\" level=\"INFO\">\n" +
+        "       <appender-ref ref=\"FOOFILE\" />\n" +
+        "  </logger>\n" +
+        "\n" +
+        "</included>";
+
+registration = context.registerService(String.class.getName(),config,props);
+
+ + +

If the config needs to be updated just re-register the service and change would be picked up

+

Exposing fragment as ConfigProvider instance

+

Another way to provide config fragment is by providing an implementation of org.apache.sling.commons.log.logback.ConfigProvider

+
@Component
+@Service
+public class ConfigProviderExample implements ConfigProvider {
+    public InputSource getConfigSource() {
+        return new InputSource(getClass().getClassLoader().getResourceAsStream("foo-config.xml"));
+    }
+}
+
+ + +

If the config changes then sending an event to org/apache/sling/commons/log/RESET would reset the Logback runtime

+
eventAdmin.sendEvent(new Event("org/apache/sling/commons/log/RESET",new Properties()));
+
+ + +

External Config File

+

Logback can be configured with an external file. The file name can be specified through

+
    +
  1. OSGi config - Look for config with name Apache Sling Logging Configuration and specify the path for + config file property
  2. +
  3. OSGi Framework Properties - Logback supports also looks for file name with property name + org.apache.sling.commons.log.configurationFile
  4. +
+

If you are providing an external config file then to support OSGi integration you would need to add following +action entry

+
<newRule pattern="*/configuration/osgi"
+         actionClass="org.apache.sling.commons.log.logback.OsgiAction"/>
+<newRule pattern="*/configuration/appender-ref-osgi"
+         actionClass="org.apache.sling.commons.log.logback.OsgiAppenderRefAction"/>
+<osgi/>
+
+ + +

The osgi element enables the OSGi integration support

+

Java Util Logging (JUL) Integration

+

The bundle also support SLF4JBridgeHandler. To enable JUL integration following two steps +needs to be done. This features allows routing logging messages from JUL to the Logbback appenders

+
    +
  1. Set framework property org.apache.sling.commons.log.julenabled to true
  2. +
  3. +

    Set the LevelChangePropagator in LogbackConfig

    +

    :::xml + + + ... +

    +
  4. +
+

Configuring OSGi based appenders in Logback Config

+

So far Sling used to configure the appenders based on OSGi config. That mode only provide a very limited +set to configuration options. To make use of other Logback features you can override the OSGi config +from within the Logback config file. OSGi config based appenders are named based on the file name

+

For example for following OSGi config

+
org.apache.sling.commons.log.file="logs/error.log"
+org.apache.sling.commons.log.level="info"
+org.apache.sling.commons.log.file.size="'.'yyyy-MM-dd"
+org.apache.sling.commons.log.file.number=I"7"
+org.apache.sling.commons.log.pattern="{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}&quo
 t;
+
+ + +

The Logback appender would be named as logs/error.log. To extend/override the config in Logback config +create an appender with name logs/error.log

+
<appender name="/logs/error.log" class="ch.qos.logback.core.FileAppender">
+  <file>${sling.home}/logs/error.log</file>
+  <encoder>
+    <pattern>%d %-5level %X{sling.userId:-NA} [%thread] %logger{30} %marker- %msg %n</pattern>
+    <immediateFlush>true</immediateFlush>
+  </encoder>
+</appender>
+
+ + +

In this case then Log module would create appender based on Logback config instead of OSGi config. This can +be used to move the application from OSGi based config to Logback based config easily

+

WebConsole Plugin enhancements

+

The web Console Plugin supports following features

+
    +
  • Displays list of loggers which have level or appender configured
  • +
  • List of File appenders with location of current active files
  • +
  • Content of LogBack config file
  • +
  • Content of various Logback config fragment
  • +
  • Logback Status logs
  • +
+

- Rev. 1529977 by dklco on Mon, 7 Oct 2013 15:40:38 +0000 + Rev. 1542742 by chetanm on Sun, 17 Nov 2013 14:56:31 +0000
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project Added: websites/staging/sling/trunk/content/documentation/legacy/logging.html ============================================================================== --- websites/staging/sling/trunk/content/documentation/legacy/logging.html (added) +++ websites/staging/sling/trunk/content/documentation/legacy/logging.html Sun Nov 17 14:56:48 2013 @@ -0,0 +1,285 @@ + + + + + Apache Sling - Logging + + + + + + +
+ +
+ + Apache + +
+
+ + + +
+
+ Home » Documentation +
+ + + +

Logging

+
+This document is for 3.x release of Sling Commons Log components. Refer to +[Logging](http://sling.apache.org/documentation/development/logging.html) for documentation related +to newer version. +
+ +

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:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDefaultDescription
org.apache.sling.commons.log.levelINFOSets the initial logging level of the root logger. This may be any of the defined logging levels DEBUG, INFO, WARN, ERROR and FATAL.
org.apache.sling.commons.log.fileundefinedSets 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.number5The number of rotated files to keep.
org.apache.sling.commons.log.file.size'.'yyyy-MM-ddDefines how the log file is rotated (by schedule or by size) and when to rotate. See the section Log File Rotation below for full details on log file rotation.
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.
org.apache.sling.commons.log.julenabledn/aEnables the java.util.logging support.
+

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.

+

Logger Configuration

+

Loggers (or Categories) can be configured to log to specific files at specific levels using configurable patterns. To this avail factory configuration instances with factory PID org.apache.sling.commons.log.LogManager.factory.config may be created and configured with the Configuration Admin Service.

+

The following properties may be set:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDefaultDescription
org.apache.sling.commons.log.levelStringINFOSets the logging level of the loggers. This may be any of the defined logging levels DEBUG, INFO, WARN, ERROR and FATAL.
org.apache.sling.commons.log.fileStringundefinedSets the log file to which log messages are written. If this property is empty or missing, log messages are written to System.out. This property should refer to the file name of a configured Log Writer (see below). If no Log Writer is configured with the same file name an implicit Log Writer configuration with default configuration is created.
org.apache.sling.commons.log.patternString{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}]() {3} {5}The java.util.MessageFormat pattern to use for formatting log messages with the root logger. This is a java.util.MessageFormat pattern supporting up to six arguments: {0} The timestamp of type java.util.Date, {1} the log marker, {2} the name of the current thread, {3} the name of the logger, {4} the debug level and {5} the actual debug message. If the log call includes a Throwable, the stacktrace is just appended to the message regardless of the pattern.
org.apache.sling.commons.log.namesString\[\]--A list of logger names to which this configuration applies.
+

Note that multiple Logger Configurations may refer to the same Log Writer Configuration. If no Log Writer Configuration exists whose file name matches the file name set on the Logger Configuration an implicit Log Writer Configuration with default setup (daily log rotation) is internally created.

+

Log Writer Configuration

+

Log Writer Configuration is used to setup file output and log file rotation characteristics for log writers used by the Loggers.

+

The following properties may be set:

+ + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyDefaultDescription
org.apache.sling.commons.log.fileundefinedSets 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.number5The number of rotated files to keep.
org.apache.sling.commons.log.file.size'.'yyyy-MM-ddDefines how the log file is rotated (by schedule or by size) and when to rotate. See the section Log File Rotation below for full details on log file rotation.
+

See the section Log File Rotation below for full details on the org.apache.sling.commons.log.file.size and org.apache.sling.commons.log.file.number properties.

+

Log File Rotation

+

Log files can grow rather quickly and fill up available disk space. To cope with this growth log files may be rotated in two ways: At specific times or when the log file reaches a configurable size. The first method is called Scheduled Rotation and is used by specifying a SimpleDateFormat pattern as the log file "size". The second method is called Size Rotation and is used by setting a maximum file size as the log file size.

+

As of version 2.0.6 of the Sling Commons Log bundle, the default value for log file scheduling is '.'yyyy-MM-dd causing daily log rotation. Previously log rotation defaulted to a 10MB file size limit.

+

Scheduled Rotation

+

The rolling schedule is specified by setting the org.apache.sling.commons.log.file.size property to a java.text.SimpleDateFormat pattern. Literal text (such as a leading dot) to be included must be enclosed within a pair of single quotes. A formatted version of the date pattern is used as the suffix for the rolled file name.

+

For example, if the log file is configured as /foo/bar.log and the pattern set to '.'yyyy-MM-dd, on 2001-02-16 at midnight, the logging file /foo/bar.log will be renamed to /foo/bar.log.2001-02-16 and logging for 2001-02-17 will continue in a new /foo/bar.log file until it rolls over the next day.

+

It is possible to specify monthly, weekly, half-daily, daily, hourly, or minutely rollover schedules.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DatePatternRollover scheduleExample
'.'yyyy-MMRollover at the beginning of each monthAt midnight of May 31st, 2002 /foo/bar.log will be copied to /foo/bar.log.2002-05. Logging for the month of June will be output to /foo/bar.log until it is also rolled over the next month.
'.'yyyy-wwRollover at the first day of each week. The first day of the week depends on the locale.Assuming the first day of the week is Sunday, on Saturday midnight, June 9th 2002, the file /foo/bar.log will be copied to /foo/bar.log.2002-23. Logging for the 24th week of 2002 will be output to /foo/bar.log until it is rolled over the next week.
'.'yyyy-MM-ddRollover at midnight each day.At midnight, on March 8th, 2002, /foo/bar.log will be copied to /foo/bar.log.2002-03-08. Logging for the 9th day of March will be output to /foo/bar.log until it is rolled over the next day.
'.'yyyy-MM-dd-aRollover at midnight and midday of each day.at noon, on March 9th, 2002, /foo/bar.log will be copied to /foo/bar.log.2002-03-09-AM. Logging for the afternoon of the 9th will be output to /foo/bar.log until it is rolled over at midnight.
'.'yyyy-MM-dd-HHRollover at the top of every hour.At approximately 11:00.000 o'clock on March 9th, 2002, /foo/bar.log will be copied to /foo/bar.log.2002-03-09-10. Logging for the 11th hour of the 9th of March will be output to /foo/bar.log until it is rolled over at the beginning of the next hour.
'.'yyyy-MM-dd-HH-mmRollover at the beginning of every minute.At approximately 11:23,000, on March 9th, 2001, /foo/bar.log will be copied to /foo/bar.log.2001-03-09-10-22. Logging for the minute of 11:23 (9th of March) will be output to /foo/bar.log until it is rolled over the next minute.
+

Do not use the colon ":" character in anywhere in the pattern option. The text before the colon is interpeted as the protocol specificaion of a URL which is probably not what you want.

+

Note that Scheduled Rotation ignores the org.apache.sling.commons.log.file.number property since the old log files are not numbered but "dated".

+

Size Rotation

+

Log file rotation by size is specified by setting the org.apache.sling.commons.log.file.size property to a plain number or a number plus a size multiplier. The size multiplier may be any of K, KB, M, MB, G, or GB where the case is ignored and the meaning is probably obvious.

+

When using Size Rotation, the org.apache.sling.commons.log.file.number defines the number of old log file generations to keep. For example to keep 5 old log files indexed by 0 through 4, set the org.apache.sling.commons.log.file.number to 5 (which happens to be the default).

+
+ Rev. 1542742 by chetanm on Sun, 17 Nov 2013 14:56:31 +0000 +
+
+ Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project + logo are trademarks of The Apache Software Foundation. All other marks mentioned + may be trademarks or registered trademarks of their respective owners. +
+
+ + Modified: websites/staging/sling/trunk/content/sitemap.html ============================================================================== --- websites/staging/sling/trunk/content/sitemap.html (original) +++ websites/staging/sling/trunk/content/sitemap.html Sun Nov 17 14:56:48 2013 @@ -122,7 +122,6 @@
  • Getting and Building Sling
  • Issue Tracker
  • Maven JspC Plugin
  • -
  • Logging
  • Logging
  • Maven Archetypes
  • Maven Launchpad Plugin