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 @@
       
       
       <h1>Logging</h1>
-      <h2 id="introduction">Introduction</h2>
-<p>Logging in Sling is supported by the 
<code>org.apache.sling.commons.log</code> bundle, which is one of the first 
bundles installed and started by the Sling Launcher. The 
<code>org.apache.sling.commons.log</code> bundle has the following tasks:</p>
+      <div class="note">
+Work in progress as part of SLING-3070
+</div>
+
+<div class="note">
+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.
+</div>
+
+<h2 id="introduction">Introduction</h2>
+<p>Logging in Sling is supported by the 
<code>org.apache.sling.commons.log</code> 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</p>
 <ul>
 <li>Implements the OSGi Log Service Specification and registers the 
<code>LogService</code> and <code>LogReader</code> services</li>
-<li>Exports three commonly used logging APIs:<ul>
+<li>Exports three commonly used logging APIs:</li>
 <li><a href="http://www.slf4j.org";>Simple Logging Facade for Java 
(SLF4J)</a></li>
 <li><a href="http://jakarta.apache.org/commons/logging";>Apache Commons 
Logging</a></li>
 <li><a href="http://logging.apache.org/log4j/index.html";>log4j</a></li>
-<li><a 
href="http://download.oracle.com/javase/6/docs/api/java/util/logging/package-summary.html";>java.util.logging</a>
 (as of r1169918)</li>
-</ul>
-</li>
-<li>Configures logging through our own implementation of the SLF4J backend 
API</li>
+<li><a 
href="http://download.oracle.com/javase/6/docs/api/java/util/logging/package-summary.html";>java.util.logging</a></li>
+<li>Configures logging through Logback which is integrated with the OSGi 
environment</li>
+<li>Logging can be configured both via editing Logback xml or via OSGi 
Configurations</li>
 </ul>
 <h2 id="initial-configuration">Initial Configuration</h2>
 <p>The <code>org.apache.sling.commons.log</code> bundle gets the initial 
configuration from the following <code>BundleContext</code> properties:</p>
@@ -139,12 +150,21 @@
 <td>n/a</td>
 <td>Enables the <code>java.util.logging</code> support.</td>
 </tr>
+<tr>
+<td><code>org.apache.sling.commons.log.configurationFile</code></td>
+<td>n/a</td>
+<td>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</td>
+</tr>
 </tbody>
 </table>
-<h2 id="user-configuration">User Configuration</h2>
-<p>User Configuration after initial configuration is provided by the 
Configuration Admin Service. To this avail two 
<code>org.osgi.services.cm.ManagedServiceFactory</code> services are registered 
under the PIDs 
<code>org.apache.sling.commons.log.LogManager.factory.writer</code> and 
<code>org.apache.sling.commons.log.LogManager.factory.config</code> which may 
receive configuration.</p>
+<h2 id="user-configuration-osgi-based">User Configuration - OSGi Based</h2>
+<p>User Configuration after initial configuration is provided by the 
Configuration Admin Service. To this avail two
+<code>org.osgi.services.cm.ManagedServiceFactory</code> services are 
registered under the PIDs 
<code>org.apache.sling.commons.log.LogManager.factory.writer</code>
+and <code>org.apache.sling.commons.log.LogManager.factory.config</code> which 
may receive configuration.</p>
 <h3 id="logger-configuration">Logger Configuration</h3>
-<p>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 
<code>org.apache.sling.commons.log.LogManager.factory.config</code> may be 
created and configured with the Configuration Admin Service.</p>
+<p>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 
<code>org.apache.sling.commons.log.LogManager.factory.config</code>
+may be created and configured with the Configuration Admin Service.</p>
 <p>The following properties may be set:</p>
 <table>
 <thead>
@@ -182,7 +202,9 @@
 </tr>
 </tbody>
 </table>
-<p>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. 
</p>
+<p>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.</p>
 <h3 id="log-writer-configuration">Log Writer Configuration</h3>
 <p>Log Writer Configuration is used to setup file output and log file rotation 
characteristics for log writers used by the Loggers.</p>
 <p>The following properties may be set:</p>
@@ -212,13 +234,24 @@
 </tr>
 </tbody>
 </table>
-<p>See the section <em>Log File Rotation</em> below for full details on the 
<code>org.apache.sling.commons.log.file.size</code> and 
<code>org.apache.sling.commons.log.file.number</code> properties.</p>
-<h2 id="log-file-rotation">Log File Rotation</h2>
-<p>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 
<em>Scheduled Rotation</em> and is used by specifying a 
<code>SimpleDateFormat</code> pattern as the log file "size". The second method 
is called <em>Size Rotation</em> and is used by setting a maximum file size as 
the log file size.</p>
-<p>As of version 2.0.6 of the Sling Commons Log bundle, the default value for 
log file scheduling is <code>'.'yyyy-MM-dd</code> causing daily log rotation. 
Previously log rotation defaulted to a 10MB file size limit.</p>
-<h3 id="scheduled-rotation">Scheduled Rotation</h3>
-<p>The rolling schedule is specified by setting the 
<code>org.apache.sling.commons.log.file.size</code> property to a 
<code>java.text.SimpleDateFormat</code> pattern. Literal text (such as a 
leading dot) to be included must be <em>enclosed</em> within a pair of single 
quotes. A formatted version of the date pattern is used as the suffix for the 
rolled file name.</p>
-<p>For example, if the log file is configured as <code>/foo/bar.log</code> and 
the pattern set to <code>'.'yyyy-MM-dd</code>, on 2001-02-16 at midnight, the 
logging file <code>/foo/bar.log</code> will be renamed to 
<code>/foo/bar.log.2001-02-16</code> and logging for 2001-02-17 will continue 
in a new <code>/foo/bar.log</code> file until it rolls over the next day.</p>
+<p>See the section <em>Log File Rotation</em> below for full details on the 
<code>org.apache.sling.commons.log.file.size</code> and
+<code>org.apache.sling.commons.log.file.number</code> properties.</p>
+<h4 id="log-file-rotation">Log File Rotation</h4>
+<p>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 <em>Scheduled Rotation</em>
+and is used by specifying a <code>SimpleDateFormat</code> pattern as the log 
file "size". The second method is called <em>Size Rotation</em>
+and is used by setting a maximum file size as the log file size.</p>
+<p>As of version 2.0.6 of the Sling Commons Log bundle, the default value for 
log file scheduling is <code>'.'yyyy-MM-dd</code>
+causing daily log rotation. Previously log rotation defaulted to a 10MB file 
size limit.</p>
+<h5 id="scheduled-rotation">Scheduled Rotation</h5>
+<p>The rolling schedule is specified by setting the 
<code>org.apache.sling.commons.log.file.size</code> property to a
+<code>java.text.SimpleDateFormat</code> pattern. Literal text (such as a 
leading dot) to be included must be <em>enclosed</em> 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 <code>TimeBasedRollingPolicy</code> for the 
appender. Refer to <a 
href="http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy";>TimeBasedRollingPolicy</a>
 for
+more details around the pattern format</p>
+<p>For example, if the log file is configured as <code>/foo/bar.log</code> and 
the pattern set to <code>'.'yyyy-MM-dd</code>, on
+2001-02-16 at midnight, the logging file <code>/foo/bar.log</code> will be 
renamed to <code>/foo/bar.log.2001-02-16</code> and logging for
+2001-02-17 will continue in a new <code>/foo/bar.log</code> file until it 
rolls over the next day.</p>
 <p>It is possible to specify monthly, weekly, half-daily, daily, hourly, or 
minutely rollover schedules.</p>
 <table>
 <thead>
@@ -261,13 +294,209 @@
 </tr>
 </tbody>
 </table>
-<p>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.</p>
-<p>Note that Scheduled Rotation ignores the 
<code>org.apache.sling.commons.log.file.number</code> property since the old 
log files are not numbered but "dated".</p>
-<h3 id="size-rotation">Size Rotation</h3>
-<p>Log file rotation by size is specified by setting the 
<code>org.apache.sling.commons.log.file.size</code> property to a plain number 
or a number plus a size multiplier. The size multiplier may be any of 
<code>K</code>, <code>KB</code>, <code>M</code>, <code>MB</code>, 
<code>G</code>, or <code>GB</code> where the case is ignored and the meaning is 
probably obvious.</p>
-<p>When using Size Rotation, the 
<code>org.apache.sling.commons.log.file.number</code> 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 <code>org.apache.sling.commons.log.file.number</code> to 
<code>5</code> (which happens to be the default).</p>
+<p>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.</p>
+<p>Note that Scheduled Rotation ignores the 
<code>org.apache.sling.commons.log.file.number</code> property since the old 
log files are
+not numbered but "dated".</p>
+<h5 id="size-rotation">Size Rotation</h5>
+<p>Log file rotation by size is specified by setting the 
<code>org.apache.sling.commons.log.file.size</code> property to a plain number
+or a number plus a size multiplier. The size multiplier may be any of 
<code>K</code>, <code>KB</code>, <code>M</code>, <code>MB</code>, 
<code>G</code>, or <code>GB</code> where the case
+is ignored and the meaning is probably obvious.</p>
+<p>When using Size Rotation, the 
<code>org.apache.sling.commons.log.file.number</code> 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 
<code>org.apache.sling.commons.log.file.number</code>
+to <code>5</code> (which happens to be the default).</p>
+<h2 id="logback-integration">Logback Integration</h2>
+<p>Logback integration provides following features</p>
+<ul>
+<li>LogBack configuration can be provided via Logback config xml</li>
+<li>Supports Appenders registered as OSGi Services</li>
+<li>Supports Filters and TurboFilters registered as OSGi Services</li>
+<li>Support providing Logback config as fragments through OSGi Service 
Registry</li>
+<li>Support for referring to Appenders registered as OSGi services from with 
Logback
+  config</li>
+<li>Exposing Logback runtime state through Felix WebConsole Plugin</li>
+</ul>
+<p>Following sections would provide more details around these features</p>
+<h3 id="turbofilters-as-osgi-service">TurboFilters as OSGi Service</h3>
+<p><a href="http://logback.qos.ch/manual/filters.html#TurboFilter";>Logback 
TurboFilter</a> operate globally and invoked for every Logback call. To 
register a <code>TurboFilter</code> as OSGi service
+the bundle just need to register a service  against 
<code>ch.qos.logback.classic.turbo.TurboFilter</code> class</p>
+<div class="codehilite"><pre><span class="kn">import</span> <span 
class="nn">import</span> <span class="n">ch</span><span class="o">.</span><span 
class="na">qos</span><span class="o">.</span><span 
class="na">logback</span><span class="o">.</span><span 
class="na">classic</span><span class="o">.</span><span 
class="na">turbo</span><span class="o">.</span><span 
class="na">MatchingFilter</span><span class="o">;</span>
+
+<span class="n">SimpleTurboFilter</span> <span class="n">stf</span> <span 
class="o">=</span> <span class="k">new</span> <span 
class="n">SimpleTurboFilter</span><span class="o">();</span>
+<span class="n">ServiceRegistration</span> <span class="n">sr</span>  <span 
class="o">=</span> <span class="n">bundleContext</span><span 
class="o">.</span><span class="na">registerService</span><span 
class="o">(</span><span class="n">TurboFilter</span><span 
class="o">.</span><span class="na">class</span><span class="o">.</span><span 
class="na">getName</span><span class="o">(),</span> <span 
class="n">stf</span><span class="o">,</span> <span class="kc">null</span><span 
class="o">);</span>
+
+<span class="kd">private</span> <span class="kd">static</span> <span 
class="kd">class</span> <span class="nc">SimpleTurboFilter</span> <span 
class="kd">extends</span> <span class="n">MatchingFilter</span> <span 
class="o">{</span>
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">FilterReply</span> <span 
class="nf">decide</span><span class="o">(</span><span class="n">Marker</span> 
<span class="n">marker</span><span class="o">,</span> <span 
class="n">Logger</span> <span class="n">logger</span><span class="o">,</span> 
<span class="n">Level</span> <span class="n">level</span><span 
class="o">,</span> <span class="n">String</span> <span 
class="n">format</span><span class="o">,</span>
+     <span class="n">Object</span><span class="o">[]</span> <span 
class="n">params</span><span class="o">,</span> <span 
class="n">Throwable</span> <span class="n">t</span><span class="o">)</span> 
<span class="o">{</span>
+        <span class="k">if</span><span class="o">(</span><span 
class="n">logger</span><span class="o">.</span><span 
class="na">getName</span><span class="o">().</span><span 
class="na">equals</span><span class="o">(</span><span 
class="s">&quot;turbofilter.foo.bar&quot;</span><span class="o">)){</span>
+                <span class="k">return</span> <span 
class="n">FilterReply</span><span class="o">.</span><span 
class="na">DENY</span><span class="o">;</span>
+        <span class="o">}</span>
+        <span class="k">return</span> <span class="n">FilterReply</span><span 
class="o">.</span><span class="na">NEUTRAL</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>As these filters are invoked for every call they must not take much time to 
execute.</p>
+<h3 id="filter-as-osgi-service">Filter as OSGi service</h3>
+<p><a href="http://logback.qos.ch/manual/filters.html";>Logback Filters</a> 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
+<code>appenders</code> which refers to list of appender names to which the 
Filter must be attached</p>
+<div class="codehilite"><pre><span class="kn">import</span> <span 
class="nn">ch.qos.logback.core.filter.Filter</span><span class="o">;</span>
+
+<span class="n">SimpleFilter</span> <span class="n">stf</span> <span 
class="o">=</span> <span class="k">new</span> <span 
class="n">SimpleFilter</span><span class="o">();</span>
+<span class="n">Dictionary</span><span class="o">&lt;</span><span 
class="n">String</span><span class="o">,</span> <span 
class="n">Object</span><span class="o">&gt;</span> <span class="n">props</span> 
<span class="o">=</span> <span class="k">new</span> <span 
class="n">Hashtable</span><span class="o">&lt;</span><span 
class="n">String</span><span class="o">,</span> <span 
class="n">Object</span><span class="o">&gt;();</span>
+<span class="n">props</span><span class="o">.</span><span 
class="na">put</span><span class="o">(</span><span 
class="s">&quot;appenders&quot;</span><span class="o">,</span> <span 
class="s">&quot;TestAppender&quot;</span><span class="o">);</span>
+<span class="n">ServiceRegistration</span> <span class="n">sr</span>  <span 
class="o">=</span> <span class="n">bundleContext</span><span 
class="o">.</span><span class="na">registerService</span><span 
class="o">(</span><span class="n">Filter</span><span class="o">.</span><span 
class="na">class</span><span class="o">.</span><span 
class="na">getName</span><span class="o">(),</span> <span 
class="n">stf</span><span class="o">,</span> <span class="n">props</span><span 
class="o">);</span>
+
+<span class="kd">private</span> <span class="kd">static</span> <span 
class="kd">class</span> <span class="nc">SimpleFilter</span> <span 
class="kd">extends</span> <span class="n">Filter</span><span 
class="o">&lt;</span><span class="n">ILoggingEvent</span><span 
class="o">&gt;</span> <span class="o">{</span>
+
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">FilterReply</span> <span 
class="nf">decide</span><span class="o">(</span><span 
class="n">ILoggingEvent</span> <span class="n">event</span><span 
class="o">)</span> <span class="o">{</span>
+        <span class="k">if</span><span class="o">(</span><span 
class="n">event</span><span class="o">.</span><span 
class="na">getLoggerName</span><span class="o">().</span><span 
class="na">equals</span><span class="o">(</span><span 
class="s">&quot;filter.foo.bar&quot;</span><span class="o">)){</span>
+            <span class="k">return</span> <span 
class="n">FilterReply</span><span class="o">.</span><span 
class="na">DENY</span><span class="o">;</span>
+        <span class="o">}</span>
+        <span class="k">return</span> <span class="n">FilterReply</span><span 
class="o">.</span><span class="na">NEUTRAL</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<h3 id="appenders-as-osgi-service">Appenders as OSGi service</h3>
+<p><a href="http://logback.qos.ch/manual/appenders.html";>Logback Appenders</a> 
handle the logging events produced by Logback. To register an 
<code>Appender</code> as OSGi service
+the bundle just need to register a service  against 
<code>ch.qos.logback.core.Appender</code> class.  When registering an
+appender the bundle needs to configure a service property <code>loggers</code> 
which refers to list of logger names to which
+the Appender must be attached</p>
+<div class="codehilite"><pre><span class="n">Dictionary</span><span 
class="o">&lt;</span><span class="n">String</span><span class="o">,</span><span 
class="n">Object</span><span class="o">&gt;</span> <span class="n">props</span> 
<span class="o">=</span> <span class="k">new</span> <span 
class="n">Hashtable</span><span class="o">&lt;</span><span 
class="n">String</span><span class="o">,</span> <span 
class="n">Object</span><span class="o">&gt;();</span>
+
+<span class="n">String</span><span class="o">[]</span> <span 
class="n">loggers</span> <span class="o">=</span> <span class="o">{</span>
+        <span class="s">&quot;foo.bar:DEBUG&quot;</span><span 
class="o">,</span>
+        <span class="s">&quot;foo.bar.zoo:INFO&quot;</span><span 
class="o">,</span>
+<span class="o">};</span>
+
+<span class="n">props</span><span class="o">.</span><span 
class="na">put</span><span class="o">(</span><span 
class="s">&quot;loggers&quot;</span><span class="o">,</span><span 
class="n">loggers</span><span class="o">);</span>
+<span class="n">sr</span> <span class="o">=</span> <span 
class="n">bundleContext</span><span class="o">.</span><span 
class="na">registerService</span><span class="o">(</span><span 
class="n">Appender</span><span class="o">.</span><span 
class="na">class</span><span class="o">.</span><span 
class="na">getName</span><span class="o">(),</span><span 
class="k">this</span><span class="o">,</span><span class="n">props</span><span 
class="o">);</span>
+</pre></div>
+
+
+<h3 id="logback-config-fragment-support">Logback Config Fragment Support</h3>
+<p>Logback supports including parts of a configuration file from another file 
(See <a 
href="http://logback.qos.ch/manual/configuration.html#fileInclusion";>File 
Inclusion</a>). This module
+extends that support by allowing other bundles to provide config fragments. 
There are two ways to achieve that</p>
+<h4 id="exposing-fragment-as-string-objects">Exposing fragment as String 
objects</h4>
+<p>If you have the config as string then you can register that String instance 
as a service with property <code>logbackConfig</code>
+set to true. Sling Logback Extension would monitor such objects and pass them 
to logback</p>
+<div class="codehilite"><pre><span class="n">Properties</span> <span 
class="n">props</span> <span class="o">=</span> <span class="k">new</span> 
<span class="n">Properties</span><span class="o">();</span>
+<span class="n">props</span><span class="o">.</span><span 
class="na">setProperty</span><span class="o">(</span><span 
class="s">&quot;logbackConfig&quot;</span><span class="o">,</span><span 
class="s">&quot;true&quot;</span><span class="o">);</span>
+
+<span class="n">String</span> <span class="n">config</span> <span 
class="o">=</span> <span class="s">&quot;&lt;included&gt;\n&quot;</span> <span 
class="o">+</span>
+        <span class="s">&quot;  &lt;appender name=\&quot;FOOFILE\&quot; 
class=\&quot;ch.qos.logback.core.FileAppender\&quot;&gt;\n&quot;</span> <span 
class="o">+</span>
+        <span class="s">&quot;    
&lt;file&gt;${sling.home}/logs/foo.log&lt;/file&gt;\n&quot;</span> <span 
class="o">+</span>
+        <span class="s">&quot;    &lt;encoder&gt;\n&quot;</span> <span 
class="o">+</span>
+        <span class="s">&quot;      &lt;pattern&gt;%d %-5level %logger{35} - 
%msg %n&lt;/pattern&gt;\n&quot;</span> <span class="o">+</span>
+        <span class="s">&quot;    &lt;/encoder&gt;\n&quot;</span> <span 
class="o">+</span>
+        <span class="s">&quot;  &lt;/appender&gt;\n&quot;</span> <span 
class="o">+</span>
+        <span class="s">&quot;\n&quot;</span> <span class="o">+</span>
+        <span class="s">&quot;  &lt;logger name=\&quot;foo.bar.include\&quot; 
level=\&quot;INFO\&quot;&gt;\n&quot;</span> <span class="o">+</span>
+        <span class="s">&quot;       &lt;appender-ref 
ref=\&quot;FOOFILE\&quot; /&gt;\n&quot;</span> <span class="o">+</span>
+        <span class="s">&quot;  &lt;/logger&gt;\n&quot;</span> <span 
class="o">+</span>
+        <span class="s">&quot;\n&quot;</span> <span class="o">+</span>
+        <span class="s">&quot;&lt;/included&gt;&quot;</span><span 
class="o">;</span>
+
+<span class="n">registration</span> <span class="o">=</span> <span 
class="n">context</span><span class="o">.</span><span 
class="na">registerService</span><span class="o">(</span><span 
class="n">String</span><span class="o">.</span><span 
class="na">class</span><span class="o">.</span><span 
class="na">getName</span><span class="o">(),</span><span 
class="n">config</span><span class="o">,</span><span 
class="n">props</span><span class="o">);</span>
+</pre></div>
+
+
+<p>If the config needs to be updated just re-register the service and change 
would be picked up</p>
+<h4 id="exposing-fragment-as-configprovider-instance">Exposing fragment as 
ConfigProvider instance</h4>
+<p>Another way to provide config fragment is by providing an implementation of 
<code>org.apache.sling.commons.log.logback.ConfigProvider</code></p>
+<div class="codehilite"><pre><span class="nd">@Component</span>
+<span class="nd">@Service</span>
+<span class="kd">public</span> <span class="kd">class</span> <span 
class="nc">ConfigProviderExample</span> <span class="kd">implements</span> 
<span class="n">ConfigProvider</span> <span class="o">{</span>
+    <span class="kd">public</span> <span class="n">InputSource</span> <span 
class="nf">getConfigSource</span><span class="o">()</span> <span 
class="o">{</span>
+        <span class="k">return</span> <span class="k">new</span> <span 
class="nf">InputSource</span><span class="o">(</span><span 
class="n">getClass</span><span class="o">().</span><span 
class="na">getClassLoader</span><span class="o">().</span><span 
class="na">getResourceAsStream</span><span class="o">(</span><span 
class="s">&quot;foo-config.xml&quot;</span><span class="o">));</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>If the config changes then sending an event to 
<code>org/apache/sling/commons/log/RESET</code> would reset the Logback 
runtime</p>
+<div class="codehilite"><pre><span class="n">eventAdmin</span><span 
class="o">.</span><span class="na">sendEvent</span><span 
class="o">(</span><span class="k">new</span> <span class="n">Event</span><span 
class="o">(</span><span 
class="s">&quot;org/apache/sling/commons/log/RESET&quot;</span><span 
class="o">,</span><span class="k">new</span> <span 
class="n">Properties</span><span class="o">()));</span>
+</pre></div>
+
+
+<h3 id="external-config-file">External Config File</h3>
+<p>Logback can be configured with an external file. The file name can be 
specified through</p>
+<ol>
+<li>OSGi config - Look for config with name <code>Apache Sling Logging 
Configuration</code> and specify the path for
+   config file property</li>
+<li>OSGi Framework Properties - Logback supports also looks for file name with 
property name
+   <code>org.apache.sling.commons.log.configurationFile</code></li>
+</ol>
+<p>If you are providing an external config file then to support OSGi 
integration you would need to add following
+action entry</p>
+<div class="codehilite"><pre><span class="nt">&lt;newRule</span> <span 
class="na">pattern=</span><span 
class="s">&quot;*/configuration/osgi&quot;</span>
+         <span class="na">actionClass=</span><span 
class="s">&quot;org.apache.sling.commons.log.logback.OsgiAction&quot;</span><span
 class="nt">/&gt;</span>
+<span class="nt">&lt;newRule</span> <span class="na">pattern=</span><span 
class="s">&quot;*/configuration/appender-ref-osgi&quot;</span>
+         <span class="na">actionClass=</span><span 
class="s">&quot;org.apache.sling.commons.log.logback.OsgiAppenderRefAction&quot;</span><span
 class="nt">/&gt;</span>
+<span class="nt">&lt;osgi/&gt;</span>
+</pre></div>
+
+
+<p>The <code>osgi</code> element enables the OSGi integration support</p>
+<h3 id="java-util-logging-jul-integration">Java Util Logging (JUL) 
Integration</h3>
+<p>The bundle also support <a 
href="http://www.slf4j.org/api/org/slf4j/bridge/SLF4JBridgeHandler.html";>SLF4JBridgeHandler</a>.
 To enable JUL integration following two steps
+needs to be done. This features allows routing logging messages from JUL to 
the Logbback appenders</p>
+<ol>
+<li>Set framework property 
<code>org.apache.sling.commons.log.julenabled</code> to true</li>
+<li>
+<p>Set the <a 
href="http://logback.qos.ch/manual/configuration.html#LevelChangePropagator";>LevelChangePropagator</a>
 in LogbackConfig</p>
+<p>:::xml
+<configuration>
+  <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
+  ...
+</configuration></p>
+</li>
+</ol>
+<h3 
id="wzxhzdk11wzxhzdk12configuring-osgi-based-appenders-in-logback-config"><a 
name="config-override"></a>Configuring OSGi based appenders in Logback 
Config</h3>
+<p>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</p>
+<p>For example for following OSGi config</p>
+<div class="codehilite"><pre><span class="n">org</span><span 
class="p">.</span><span class="n">apache</span><span class="p">.</span><span 
class="n">sling</span><span class="p">.</span><span 
class="n">commons</span><span class="p">.</span><span 
class="nb">log</span><span class="p">.</span><span class="n">file</span><span 
class="p">=</span>&quot;<span class="n">logs</span><span 
class="o">/</span><span class="n">error</span><span class="p">.</span><span 
class="nb">log</span>&quot;
+<span class="n">org</span><span class="p">.</span><span 
class="n">apache</span><span class="p">.</span><span 
class="n">sling</span><span class="p">.</span><span 
class="n">commons</span><span class="p">.</span><span 
class="nb">log</span><span class="p">.</span><span class="n">level</span><span 
class="p">=</span>&quot;<span class="n">info</span>&quot;
+<span class="n">org</span><span class="p">.</span><span 
class="n">apache</span><span class="p">.</span><span 
class="n">sling</span><span class="p">.</span><span 
class="n">commons</span><span class="p">.</span><span 
class="nb">log</span><span class="p">.</span><span class="n">file</span><span 
class="p">.</span><span class="nb">size</span><span 
class="p">=</span>&quot;<span class="s">&#39;.&#39;</span><span 
class="n">yyyy</span><span class="o">-</span><span class="n">MM</span><span 
class="o">-</span><span class="n">dd</span>&quot;
+<span class="n">org</span><span class="p">.</span><span 
class="n">apache</span><span class="p">.</span><span 
class="n">sling</span><span class="p">.</span><span 
class="n">commons</span><span class="p">.</span><span 
class="nb">log</span><span class="p">.</span><span class="n">file</span><span 
class="p">.</span><span class="n">number</span><span class="p">=</span><span 
class="n">I</span>&quot;7&quot;
+<span class="n">org</span><span class="p">.</span><span 
class="n">apache</span><span class="p">.</span><span 
class="n">sling</span><span class="p">.</span><span 
class="n">commons</span><span class="p">.</span><span 
class="nb">log</span><span class="p">.</span><span 
class="n">pattern</span><span class="p">=</span>&quot;<span 
class="p">{</span>0<span class="p">,</span><span class="n">date</span><span 
class="p">,</span><span class="n">dd</span><span class="p">.</span><span 
class="n">MM</span><span class="p">.</span><span class="n">yyyy</span> <span 
class="n">HH</span><span class="p">:</span><span class="n">mm</span><span 
class="p">:</span><span class="n">ss</span><span class="p">.</span><span 
class="n">SSS</span><span class="p">}</span> <span class="o">*</span><span 
class="p">{</span>4<span class="p">}</span><span class="o">*</span> <span 
class="p">[{</span>2<span class="p">}]</span> <span class="p">{</span>3<span 
class="p">}</span> <span class="p">{</span>5<span class="p">}</span>&quo
 t;
+</pre></div>
+
+
+<p>The Logback appender would be named as <code>logs/error.log</code>. To 
extend/override the config in Logback config
+create an appender with name <code>logs/error.log</code></p>
+<div class="codehilite"><pre><span class="nt">&lt;appender</span> <span 
class="na">name=</span><span class="s">&quot;/logs/error.log&quot;</span> <span 
class="na">class=</span><span 
class="s">&quot;ch.qos.logback.core.FileAppender&quot;</span><span 
class="nt">&gt;</span>
+  <span class="nt">&lt;file&gt;</span>${sling.home}/logs/error.log<span 
class="nt">&lt;/file&gt;</span>
+  <span class="nt">&lt;encoder&gt;</span>
+    <span class="nt">&lt;pattern&gt;</span>%d %-5level %X{sling.userId:-NA} 
[%thread] %logger{30} %marker- %msg %n<span class="nt">&lt;/pattern&gt;</span>
+    <span class="nt">&lt;immediateFlush&gt;</span>true<span 
class="nt">&lt;/immediateFlush&gt;</span>
+  <span class="nt">&lt;/encoder&gt;</span>
+<span class="nt">&lt;/appender&gt;</span>
+</pre></div>
+
+
+<p>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</p>
+<h2 id="webconsole-plugin-enhancements">WebConsole Plugin enhancements</h2>
+<p>The web Console Plugin supports following features</p>
+<ul>
+<li>Displays list of loggers which have level or appender configured</li>
+<li>List of File appenders with location of current active files</li>
+<li>Content of LogBack config file</li>
+<li>Content of various Logback config fragment</li>
+<li>Logback Status logs</li>
+</ul>
+<p><img src="sling-log-support.png" /></p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; 
text-align: right;">
-        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
       </div>
       <div class="trademarkFooter"> 
         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 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<html>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE- 2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+  <head>
+    <title>Apache Sling - Logging</title>
+    <link rel="icon" href="/res/favicon.ico">
+    <link rel="stylesheet" href="/res/site.css" type="text/css" media="all">
+    <link rel="stylesheet" href="/res/codehilite.css" type="text/css" 
media="all">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://sling.apache.org/";>
+          <img border="0" alt="Apache Sling" src="/res/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/";>
+          <img border="0" alt="Apache" src="/res/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><strong><a href="/documentation.html">Documentation</a></strong> <br 
/>
+<a href="/documentation/getting-started.html">Getting Started</a> <br />
+<a href="/documentation/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/documentation/development.html">Development</a> <br />
+<a href="/documentation/bundles.html">Bundles</a> <br />
+<a href="/documentation/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> 
<br />
+<a href="/documentation/configuration.html">Configuration</a> <br />
+<a href="http://s.apache.org/sling.wiki";>Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq";>FAQ</a> <br />
+<a href="/sitemap.html">Site Map</a></p>
+<p><strong>API Docs</strong>  <br />
+<a href="/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="/apidocs/sling5/index.html">Sling 5</a>   </p>
+<p><strong>Project info</strong> <br />
+<a href="/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/";>License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING";>Issue Tracker</a> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk";>Browse Source 
Repository</a> <br />
+<a href="/project-information/security.html">Security</a>   </p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html";>Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html";>Become a 
Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html";>Buy Stuff</a>   </p>
+<!-- no valid ads for now, we'll  reactivate this when needed
+<iframe 
+    src="http://www.apache.org/ads/button.html";
+    style="border-width:0; float: left" frameborder="0" 
+    scrolling="no"
+    width="135" 
+    height="135">
+</iframe>
+-->
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>&nbsp;&raquo&nbsp;<a 
href="/documentation.html">Documentation</a>
+      </div>
+
+      
+      
+      <h1>Logging</h1>
+      <div class="note">
+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.
+</div>
+
+<h2 id="introduction">Introduction</h2>
+<p>Logging in Sling is supported by the 
<code>org.apache.sling.commons.log</code> bundle, which is one of the first 
bundles installed and started by the Sling Launcher. The 
<code>org.apache.sling.commons.log</code> bundle has the following tasks:</p>
+<ul>
+<li>Implements the OSGi Log Service Specification and registers the 
<code>LogService</code> and <code>LogReader</code> services</li>
+<li>Exports three commonly used logging APIs:<ul>
+<li><a href="http://www.slf4j.org";>Simple Logging Facade for Java 
(SLF4J)</a></li>
+<li><a href="http://jakarta.apache.org/commons/logging";>Apache Commons 
Logging</a></li>
+<li><a href="http://logging.apache.org/log4j/index.html";>log4j</a></li>
+<li><a 
href="http://download.oracle.com/javase/6/docs/api/java/util/logging/package-summary.html";>java.util.logging</a>
 (as of r1169918)</li>
+</ul>
+</li>
+<li>Configures logging through our own implementation of the SLF4J backend 
API</li>
+</ul>
+<h2 id="initial-configuration">Initial Configuration</h2>
+<p>The <code>org.apache.sling.commons.log</code> bundle gets the initial 
configuration from the following <code>BundleContext</code> properties:</p>
+<table>
+<thead>
+<tr>
+<th>Property</th>
+<th>Default</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>org.apache.sling.commons.log.level</code></td>
+<td><code>INFO</code></td>
+<td>Sets the initial logging level of the root logger. This may be any of the 
defined logging levels <code>DEBUG</code>, <code>INFO</code>, 
<code>WARN</code>, <code>ERROR</code> and <code>FATAL</code>.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.file</code></td>
+<td>undefined</td>
+<td>Sets the log file to which log messages are written. If this property is 
empty or missing, log messages are written to <code>System.out</code>.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.file.number</code></td>
+<td>5</td>
+<td>The number of rotated files to keep.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.file.size</code></td>
+<td>'.'yyyy-MM-dd</td>
+<td>Defines how the log file is rotated (by schedule or by size) and when to 
rotate. See the section <em>Log File Rotation</em> below for full details on 
log file rotation.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.pattern</code></td>
+<td>{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}]() {3} {5}</td>
+<td>The <code>MessageFormat</code> pattern to use for formatting log messages 
with the root logger.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.julenabled</code></td>
+<td>n/a</td>
+<td>Enables the <code>java.util.logging</code> support.</td>
+</tr>
+</tbody>
+</table>
+<h2 id="user-configuration">User Configuration</h2>
+<p>User Configuration after initial configuration is provided by the 
Configuration Admin Service. To this avail two 
<code>org.osgi.services.cm.ManagedServiceFactory</code> services are registered 
under the PIDs 
<code>org.apache.sling.commons.log.LogManager.factory.writer</code> and 
<code>org.apache.sling.commons.log.LogManager.factory.config</code> which may 
receive configuration.</p>
+<h3 id="logger-configuration">Logger Configuration</h3>
+<p>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 
<code>org.apache.sling.commons.log.LogManager.factory.config</code> may be 
created and configured with the Configuration Admin Service.</p>
+<p>The following properties may be set:</p>
+<table>
+<thead>
+<tr>
+<th>Property</th>
+<th>Type</th>
+<th>Default</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>org.apache.sling.commons.log.level</code></td>
+<td><code>String</code></td>
+<td><code>INFO</code></td>
+<td>Sets the logging level of the loggers. This may be any of the defined 
logging levels <code>DEBUG</code>, <code>INFO</code>, <code>WARN</code>, 
<code>ERROR</code> and <code>FATAL</code>.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.file</code></td>
+<td><code>String</code></td>
+<td>undefined</td>
+<td>Sets the log file to which log messages are written. If this property is 
empty or missing, log messages are written to <code>System.out</code>. 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.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.pattern</code></td>
+<td><code>String</code></td>
+<td>{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}]() {3} {5}</td>
+<td>The <code>java.util.MessageFormat</code> pattern to use for formatting log 
messages with the root logger. This is a <code>java.util.MessageFormat</code> 
pattern supporting up to six arguments: {0} The timestamp of type 
<code>java.util.Date</code>, {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.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.names</code></td>
+<td><code>String\[\]</code></td>
+<td>--</td>
+<td>A list of logger names to which this configuration applies.</td>
+</tr>
+</tbody>
+</table>
+<p>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. 
</p>
+<h3 id="log-writer-configuration">Log Writer Configuration</h3>
+<p>Log Writer Configuration is used to setup file output and log file rotation 
characteristics for log writers used by the Loggers.</p>
+<p>The following properties may be set:</p>
+<table>
+<thead>
+<tr>
+<th>Property</th>
+<th>Default</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>org.apache.sling.commons.log.file</code></td>
+<td>undefined</td>
+<td>Sets the log file to which log messages are written. If this property is 
empty or missing, log messages are written to <code>System.out</code>.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.file.number</code></td>
+<td>5</td>
+<td>The number of rotated files to keep.</td>
+</tr>
+<tr>
+<td><code>org.apache.sling.commons.log.file.size</code></td>
+<td>'.'yyyy-MM-dd</td>
+<td>Defines how the log file is rotated (by schedule or by size) and when to 
rotate. See the section <em>Log File Rotation</em> below for full details on 
log file rotation.</td>
+</tr>
+</tbody>
+</table>
+<p>See the section <em>Log File Rotation</em> below for full details on the 
<code>org.apache.sling.commons.log.file.size</code> and 
<code>org.apache.sling.commons.log.file.number</code> properties.</p>
+<h2 id="log-file-rotation">Log File Rotation</h2>
+<p>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 
<em>Scheduled Rotation</em> and is used by specifying a 
<code>SimpleDateFormat</code> pattern as the log file "size". The second method 
is called <em>Size Rotation</em> and is used by setting a maximum file size as 
the log file size.</p>
+<p>As of version 2.0.6 of the Sling Commons Log bundle, the default value for 
log file scheduling is <code>'.'yyyy-MM-dd</code> causing daily log rotation. 
Previously log rotation defaulted to a 10MB file size limit.</p>
+<h3 id="scheduled-rotation">Scheduled Rotation</h3>
+<p>The rolling schedule is specified by setting the 
<code>org.apache.sling.commons.log.file.size</code> property to a 
<code>java.text.SimpleDateFormat</code> pattern. Literal text (such as a 
leading dot) to be included must be <em>enclosed</em> within a pair of single 
quotes. A formatted version of the date pattern is used as the suffix for the 
rolled file name.</p>
+<p>For example, if the log file is configured as <code>/foo/bar.log</code> and 
the pattern set to <code>'.'yyyy-MM-dd</code>, on 2001-02-16 at midnight, the 
logging file <code>/foo/bar.log</code> will be renamed to 
<code>/foo/bar.log.2001-02-16</code> and logging for 2001-02-17 will continue 
in a new <code>/foo/bar.log</code> file until it rolls over the next day.</p>
+<p>It is possible to specify monthly, weekly, half-daily, daily, hourly, or 
minutely rollover schedules.</p>
+<table>
+<thead>
+<tr>
+<th>DatePattern</th>
+<th>Rollover schedule</th>
+<th>Example</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>'.'yyyy-MM</code></td>
+<td>Rollover at the beginning of each month</td>
+<td>At midnight of May 31st, 2002 <code>/foo/bar.log</code> will be copied to 
<code>/foo/bar.log.2002-05</code>. Logging for the month of June will be output 
to <code>/foo/bar.log</code> until it is also rolled over the next month.</td>
+</tr>
+<tr>
+<td><code>'.'yyyy-ww</code></td>
+<td>Rollover at the first day of each week. The first day of the week depends 
on the locale.</td>
+<td>Assuming the first day of the week is Sunday, on Saturday midnight, June 
9th 2002, the file <code>/foo/bar.log</code> will be copied to 
<code>/foo/bar.log.2002-23</code>. Logging for the 24th week of 2002 will be 
output to <code>/foo/bar.log</code> until it is rolled over the next week.</td>
+</tr>
+<tr>
+<td><code>'.'yyyy-MM-dd</code></td>
+<td>Rollover at midnight each day.</td>
+<td>At midnight, on March 8th, 2002, <code>/foo/bar.log</code> will be copied 
to <code>/foo/bar.log.2002-03-08</code>. Logging for the 9th day of March will 
be output to <code>/foo/bar.log</code> until it is rolled over the next 
day.</td>
+</tr>
+<tr>
+<td><code>'.'yyyy-MM-dd-a</code></td>
+<td>Rollover at midnight and midday of each day.</td>
+<td>at noon, on March 9th, 2002, <code>/foo/bar.log</code> will be copied to  
<code>/foo/bar.log.2002-03-09-AM</code>. Logging for the afternoon of the 9th 
will be output to <code>/foo/bar.log</code> until it is rolled over at 
midnight.</td>
+</tr>
+<tr>
+<td><code>'.'yyyy-MM-dd-HH</code></td>
+<td>Rollover at the top of every hour.</td>
+<td>At approximately 11:00.000 o'clock on March 9th, 2002, 
<code>/foo/bar.log</code> will be copied to 
<code>/foo/bar.log.2002-03-09-10</code>. Logging for the 11th hour of the 9th 
of March will be output to <code>/foo/bar.log</code> until it is rolled over at 
the beginning of the next hour.</td>
+</tr>
+<tr>
+<td><code>'.'yyyy-MM-dd-HH-mm</code></td>
+<td>Rollover at the beginning of every minute.</td>
+<td>At approximately 11:23,000, on March 9th, 2001, <code>/foo/bar.log</code> 
will be copied to <code>/foo/bar.log.2001-03-09-10-22</code>. Logging for the 
minute of 11:23 (9th of March) will be output to <code>/foo/bar.log</code> 
until it is rolled over the next minute.</td>
+</tr>
+</tbody>
+</table>
+<p>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.</p>
+<p>Note that Scheduled Rotation ignores the 
<code>org.apache.sling.commons.log.file.number</code> property since the old 
log files are not numbered but "dated".</p>
+<h3 id="size-rotation">Size Rotation</h3>
+<p>Log file rotation by size is specified by setting the 
<code>org.apache.sling.commons.log.file.size</code> property to a plain number 
or a number plus a size multiplier. The size multiplier may be any of 
<code>K</code>, <code>KB</code>, <code>M</code>, <code>MB</code>, 
<code>G</code>, or <code>GB</code> where the case is ignored and the meaning is 
probably obvious.</p>
+<p>When using Size Rotation, the 
<code>org.apache.sling.commons.log.file.number</code> 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 <code>org.apache.sling.commons.log.file.number</code> to 
<code>5</code> (which happens to be the default).</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; 
text-align: right;">
+        Rev. 1542742 by chetanm on Sun, 17 Nov 2013 14:56:31 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        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.
+      </div>
+    </div>
+  </body>
+</html>

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 @@
 <li><a 
href="/documentation/development/getting-and-building-sling.html">Getting and 
Building Sling</a></li>
 <li><a href="/documentation/development/issue-tracker.html">Issue 
Tracker</a></li>
 <li><a href="/documentation/development/jspc.html">Maven JspC Plugin</a></li>
-<li><a href="/documentation/development/logging-new.html">Logging</a></li>
 <li><a href="/documentation/development/logging.html">Logging</a></li>
 <li><a href="/documentation/development/maven-archetypes.html">Maven 
Archetypes</a></li>
 <li><a href="/documentation/development/maven-launchpad-plugin.html">Maven 
Launchpad Plugin</a></li>


Reply via email to