[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.21-5-g521dfe2

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Fri Jun 11 00:35:38 CEST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  521dfe290dfa34fadb247ee63607a0cddaaf181f (commit)
      from  a3d37a0a47c061d7c8fa5185f2c1948ff9cf053d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=521dfe290dfa34fadb247ee63607a0cddaaf181f
http://github.com/ceki/logback/commit/521dfe290dfa34fadb247ee63607a0cddaaf181f

commit 521dfe290dfa34fadb247ee63607a0cddaaf181f
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Fri Jun 11 00:32:05 2010 +0200

    - ongoing work on Gaffer (the configurator in gr0ovy)

diff --git a/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/Configurator.groovy b/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/GafferConfigurator.groovy
similarity index 80%
rename from logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/Configurator.groovy
rename to logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/GafferConfigurator.groovy
index 09d6baf..ffd99cb 100644
--- a/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/Configurator.groovy
+++ b/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/GafferConfigurator.groovy
@@ -15,22 +15,32 @@ package ch.qos.logback.classic.gaffer
 
 import ch.qos.logback.classic.LoggerContext
 import ch.qos.logback.core.util.ContextUtil
+import ch.qos.logback.core.CoreConstants
 
-class Configurator {
+class GafferConfigurator {
 
   LoggerContext context
   //ConfigurationDelegate configurationDelegate = new ConfigurationDelegate();
 
-  Configurator(LoggerContext context) {
+  GafferConfigurator(LoggerContext context) {
     this.context = context
     //configurationDelegate.context = context;
   }
 
+  protected void informContextOfURLUsedForConfiguration(URL url) {
+    context.putObject(CoreConstants.URL_OF_LAST_CONFIGURATION_VIA_JORAN, url);
+  }
+
+  void run(URL url) {
+    informContextOfURLUsedForConfiguration(url);
+    run(url.text);
+  }
+
   void run(String dslText) {
     Binding binding = new Binding();
     binding.setProperty("hostname", ContextUtil.getLocalHostName());
     Script dslScript = new GroovyShell(binding).parse(dslText)
-    
+
     dslScript.metaClass.mixin(ConfigurationDelegate)
     dslScript.setContext(context)
     dslScript.metaClass.getDeclaredOrigin = { println "getDeclaredOrigin"; dslScript }
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/jmx/JMXConfigurator.java b/logback-classic/src/main/java/ch/qos/logback/classic/jmx/JMXConfigurator.java
index 89f2415..4bada7e 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/jmx/JMXConfigurator.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/jmx/JMXConfigurator.java
@@ -44,7 +44,7 @@ import ch.qos.logback.core.util.StatusPrinter;
  * A class that provides access to logback components via JMX.
  * 
  * <p>Since this class implements {@link JMXConfiguratorMBean} it has to be
- * named as Configurator}.
+ * named as JMXConfigurator}.
  * 
  * @author Ceki G&uuml;lc&uuml;
  * @author S&eacute;bastien Pennec
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextInitializer.java b/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextInitializer.java
index 527bac3..020c97b 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextInitializer.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextInitializer.java
@@ -21,7 +21,9 @@ import java.util.List;
 
 import ch.qos.logback.classic.BasicConfigurator;
 import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.gaffer.GafferConfigurator;
 import ch.qos.logback.classic.joran.JoranConfigurator;
+import ch.qos.logback.core.CoreConstants;
 import ch.qos.logback.core.joran.spi.JoranException;
 import ch.qos.logback.core.status.ErrorStatus;
 import ch.qos.logback.core.status.InfoStatus;
@@ -32,13 +34,15 @@ import ch.qos.logback.core.util.OptionHelper;
 
 // contributors
 // Ted Graham, Matt Fowles, see also http://jira.qos.ch/browse/LBCORE-32
+
 /**
  * This class contains logback's logic for automatic configuration
- * 
+ *
  * @author Ceki Gulcu
  */
 public class ContextInitializer {
 
+  final public static String GROOVY_AUTOCONFIG_FILE = "logback.groovy";
   final public static String AUTOCONFIG_FILE = "logback.xml";
   final public static String TEST_AUTOCONFIG_FILE = "logback-test.xml";
   final public static String CONFIG_FILE_PROPERTY = "logback.configurationFile";
@@ -55,6 +59,28 @@ public class ContextInitializer {
     if (url == null) {
       throw new IllegalArgumentException("URL argument cannot be null");
     }
+    if (url.toString().endsWith("groovy")) {
+      if (EnvUtil.isGroovyAvailable()) {
+        GafferConfigurator gafferConfigurator = new GafferConfigurator(loggerContext);
+        gafferConfigurator.run(url);
+      } else {
+        StatusManager sm = loggerContext.getStatusManager();
+        if (url == null) {
+          sm.add(new ErrorStatus("Groovy classes are not available on the class path]",
+                  loggerContext));
+        }
+      }
+
+
+      if (url.toString().endsWith("xml")) {
+        JoranConfigurator configurator = new JoranConfigurator();
+        configurator.setContext(loggerContext);
+        configurator.doConfigure(url);
+      }
+
+    }
+
+  void joranConfigureByResource(URL url) throws JoranException {
     JoranConfigurator configurator = new JoranConfigurator();
     configurator.setContext(loggerContext);
     configurator.doConfigure(url);
@@ -62,7 +88,7 @@ public class ContextInitializer {
 
   private URL findConfigFileURLFromSystemProperties(ClassLoader classLoader, boolean updateStatus) {
     String logbackConfigFile = OptionHelper.getSystemProperty(CONFIG_FILE_PROPERTY);
-    
+
     if (logbackConfigFile != null) {
       URL result = null;
       try {
@@ -99,17 +125,23 @@ public class ContextInitializer {
       return url;
     }
 
-    url = Loader.getResource(TEST_AUTOCONFIG_FILE, myClassLoader);
-    if (updateStatus) {
-      statusOnResourceSearch(TEST_AUTOCONFIG_FILE, myClassLoader, url);
+    url = getResource(GROOVY_AUTOCONFIG_FILE, myClassLoader, updateStatus);
+    if (url != null) {
+      return url;
     }
+
+    url = getResource(TEST_AUTOCONFIG_FILE, myClassLoader, updateStatus);
     if (url != null) {
       return url;
     }
 
-    url = Loader.getResource(AUTOCONFIG_FILE, myClassLoader);
+    return getResource(AUTOCONFIG_FILE, myClassLoader, updateStatus);
+  }
+
+  private URL getResource(String filename, ClassLoader myClassLoader, boolean updateStatus) {
+    URL url = Loader.getResource(GROOVY_AUTOCONFIG_FILE, myClassLoader);
     if (updateStatus) {
-      statusOnResourceSearch(AUTOCONFIG_FILE, myClassLoader, url);
+      statusOnResourceSearch(GROOVY_AUTOCONFIG_FILE, myClassLoader, url);
     }
     return url;
   }
@@ -124,33 +156,33 @@ public class ContextInitializer {
     }
   }
 
-  private void multiplicityWarning(String resourceName, ClassLoader classLoader ) {
+  private void multiplicityWarning(String resourceName, ClassLoader classLoader) {
     List<URL> urlList = null;
     StatusManager sm = loggerContext.getStatusManager();
     try {
       urlList = Loader.getResourceOccurenceCount(resourceName, classLoader);
     } catch (IOException e) {
       sm.add(new ErrorStatus("Failed to get url list for resource [" + resourceName + "]",
-          loggerContext, e));
+              loggerContext, e));
     }
-    if(urlList != null && urlList.size() > 1) {
+    if (urlList != null && urlList.size() > 1) {
       sm.add(new WarnStatus("Resource [" + resourceName + "] occurs multiple times on the classpath.",
-          loggerContext));
-      for(URL url: urlList) {
-      sm.add(new WarnStatus("Resource ["+resourceName+"] occurs at ["+url.toString()+"]",
-          loggerContext));
+              loggerContext));
+      for (URL url : urlList) {
+        sm.add(new WarnStatus("Resource [" + resourceName + "] occurs at [" + url.toString() + "]",
+                loggerContext));
       }
     }
   }
-  
+
   private void statusOnResourceSearch(String resourceName, ClassLoader classLoader, URL url) {
     StatusManager sm = loggerContext.getStatusManager();
     if (url == null) {
       sm.add(new InfoStatus("Could NOT find resource [" + resourceName + "]",
-          loggerContext));
+              loggerContext));
     } else {
-      sm.add(new InfoStatus("Found resource [" + resourceName + "] at ["+url.toString()+"]",
-          loggerContext));
+      sm.add(new InfoStatus("Found resource [" + resourceName + "] at [" + url.toString() + "]",
+              loggerContext));
       multiplicityWarning(resourceName, classLoader);
     }
   }
diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/util/EnvUtil.java b/logback-classic/src/main/java/ch/qos/logback/classic/util/EnvUtil.java
new file mode 100644
index 0000000..ccd4ee3
--- /dev/null
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/util/EnvUtil.java
@@ -0,0 +1,32 @@
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ * Copyright (C) 1999-2010, QOS.ch. All rights reserved.
+ *
+ * This program and the accompanying materials are dual-licensed under
+ * either the terms of the Eclipse Public License v1.0 as published by
+ * the Eclipse Foundation
+ *
+ *   or (per the licensee's choosing)
+ *
+ * under the terms of the GNU Lesser General Public License version 2.1
+ * as published by the Free Software Foundation.
+ */
+package ch.qos.logback.classic.util;
+
+/**
+ * @author Ceki G&uuml;c&uuml;
+ */
+public class EnvUtil {
+
+
+  static boolean isGroovyAvailable() {
+    ClassLoader classLoader =  EnvUtil.class.getClassLoader();
+    try {
+      Class bindingClass = classLoader.loadClass("groovy.lang.Binding");
+      return (bindingClass != null);
+    } catch (ClassNotFoundException e) {
+      return false;
+    }
+  }
+
+}
diff --git a/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfiguratorTest.groovy b/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/GafferConfiguratorTest.groovy
similarity index 98%
rename from logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfiguratorTest.groovy
rename to logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/GafferConfiguratorTest.groovy
index f35daf0..aadeaca 100644
--- a/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfiguratorTest.groovy
+++ b/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/GafferConfiguratorTest.groovy
@@ -37,13 +37,13 @@ import static org.junit.Assert.assertTrue
 /**
  * @author Ceki G&uuml;c&uuml;
  */
-class ConfiguratorTest {
+class GafferConfiguratorTest {
 
   LoggerContext context = new LoggerContext();
   Logger root = context.getLogger(Logger.ROOT_LOGGER_NAME)
   Logger logger = context.getLogger(this.getClass())
   int diff = RandomUtil.getPositiveInt();
-  Configurator configurator = new Configurator(context);
+  GafferConfigurator configurator = new GafferConfigurator(context);
 
   @Before
   void setUp() {
diff --git a/logback-classic/src/test/groovy/ch/qos/logback/classic/sift/GSiftingAppenderTest.groovy b/logback-classic/src/test/groovy/ch/qos/logback/classic/sift/GSiftingAppenderTest.groovy
index f0441d0..c694e74 100644
--- a/logback-classic/src/test/groovy/ch/qos/logback/classic/sift/GSiftingAppenderTest.groovy
+++ b/logback-classic/src/test/groovy/ch/qos/logback/classic/sift/GSiftingAppenderTest.groovy
@@ -13,7 +13,7 @@
  */
 package ch.qos.logback.classic.sift
 
-import ch.qos.logback.classic.gaffer.Configurator
+import ch.qos.logback.classic.gaffer.GafferConfigurator
 
 import ch.qos.logback.classic.Logger
 import ch.qos.logback.classic.LoggerContext
@@ -41,7 +41,7 @@ class GSiftingAppenderTest {
   Logger root = context.getLogger(Logger.ROOT_LOGGER_NAME)
   Logger logger = context.getLogger(this.getClass())
   int diff = RandomUtil.getPositiveInt();
-  Configurator configurator = new Configurator(context);
+  GafferConfigurator configurator = new GafferConfigurator(context);
   StatusChecker checker = new StatusChecker(context)
 
   @After
diff --git a/logback-site/src/site/pages/css/common.css b/logback-site/src/site/pages/css/common.css
index 1d3489b..874a82c 100644
--- a/logback-site/src/site/pages/css/common.css
+++ b/logback-site/src/site/pages/css/common.css
@@ -219,8 +219,9 @@ table.bodyTable tr td p:first-child {
   font-weight: bold;	
 }
 
-code {
+.code {
 	font-family: Courier, monospace;
+ 	color: #666;	
 }
 
 .variable {
diff --git a/logback-site/src/site/pages/manual/architecture.html b/logback-site/src/site/pages/manual/architecture.html
index 7a5bf06..9b1fb85 100644
--- a/logback-site/src/site/pages/manual/architecture.html
+++ b/logback-site/src/site/pages/manual/architecture.html
@@ -538,7 +538,7 @@ Logger y = LoggerFactory.getLogger("wombat");</pre>
 		</p>
 		<div class="definition">
 
-			<div class="deftitle">Appender Additivity</div>
+			<div class="deftitle"><a name="additivity" href="#additivity">Appender Additivity</a></div>
 
 			<p>The output of a log statement of logger <em>L</em> will go to
 			all the appenders in <em>L</em> and its ancestors. This is the
diff --git a/logback-site/src/site/pages/manual/groovy.html b/logback-site/src/site/pages/manual/groovy.html
index 440aa78..81be827 100644
--- a/logback-site/src/site/pages/manual/groovy.html
+++ b/logback-site/src/site/pages/manual/groovy.html
@@ -41,16 +41,16 @@
     <script src="../templates/creative.js" type="text/javascript"></script>
 
 
-    <p>Domains-specific languages are rather pervasive. The XML-based
-    logback configuration can be viewed as an example DSL. By the very
-    nature of XML, XML-based configuration files are quite verbose and
-    bulky. Moreover, a relatively large body of code in logback,
-    namely Joran, is dedicated to processes these XML-based
-    configuration files. Joran supports nifty features such as
-    variable substitution, conditional processing and on-the-fly
-    extensibility. However, not only Joran is a complex beast, the
-    user-experience it provides can be described as unsatisfactory or
-    at the very least unintuitive.
+    <p>Domains-specific languages or DSLs are rather pervasive. The
+    XML-based logback configuration can be viewed as a DSL
+    instance. By the very nature of XML, XML-based configuration files
+    are quite verbose and rather bulky. Moreover, a relatively large
+    body of code in logback, namely Joran, is dedicated to processes
+    these XML-based configuration files. Joran supports nifty features
+    such as variable substitution, conditional processing and
+    on-the-fly extensibility. However, not only Joran is a complex
+    beast, the user-experience it provides can be described as
+    unsatisfactory or at the very least unintuitive.
     </p>
 
     <p>The Groovy-based DSL described in this chapter aims to be
@@ -72,36 +72,204 @@
     within a <em>logback.groovy</em> file. However, since configuring
     logback progammatically using Java syntax can be very cumbersome,
     we added a few logback-specific extensions to make your life
-    easier. We limited the number of such logback-specific extensions
-    to an absolute minimum. If you are already familiar with groovy,
-    you should be able to read, understand and even write your own
-    logback.groovy files with great ease. Those unfamiliar with Groovy
-    should still find logback.groovy syntax much more comfortable to
-    use than logback.xml.
+    easier. We try hard to limit the number of logback-specific
+    syntactic extensions to an absolute minimum. If you are already
+    familiar with groovy, you should be able to read, understand and
+    even write your own <em>logback.groovy</em> files with great
+    ease. Those unfamiliar with Groovy should still find
+    <em>logback.groovy</em> syntax much more comfortable to use than
+    <em>logback.xml</em>.
     </p>
 
-    <p>Logback.groovy syntax consists of 6 methods described next in
-    their customary order of appearance. Strictly speaking the order
-    of invocation of the methods does matter except that appenders
-    MUST be defined before they can be attached to a logger.</p>
+    <p><em>Logback.groovy</em> syntax consists of half a dozen methods
+    described next in the reverse order of their customary
+    appearance. Strictly speaking, the order of invocation of these
+    methods does NOT matter, with one exception: appenders MUST be
+    defined before they can be attached to a logger.</p>
 
-    <h3><code>scan(String scanPeriodStr = null)</code> method</h3>
+    <!-- ========================================================== -->
+
+    <h3> &#8226; <span class="code">root(Level level, List&lt;String> appenderNames = [])</span></h3>
+
+    <p>The <code>root</code> method can be used to set the level of
+    the root logger. As an optional second argument of type
+    <code>List&lt;String></code>, can be used to attach previously
+    defined appenders by name. If you do not specify the list of
+    appender names, then an empty list is assumed. In groovy, an empty
+    list is denoted by <code>[]</code>.</p>
+
+    <p>To set the level of the root logger to WARN, you would write:</p>
+
+    <pre class="prettyprint">import static ch.qos.logback.classic.Level.WARN
+
+root(WARN)</pre>
+
+    <p>To set the level of the root logger to DEBUG, and attach 
+    appenders named "CONSOLE" and "FILE" to root, you would write:</p>
+
+    <pre class="prettyprint">import static ch.qos.logback.classic.Level.INFO
+
+root(INFO, ["CONSOLE", "FILE"])</pre>
+
+    <p>In the previous example, it is assumed that the appenders named
+    "CONSOLE" and "FILE" were already defined. Defining appenders will
+    be discussed shortly.
+    </p>
+
+    <!-- ========================================================== -->
+
+    <h3>&#8226; <span class="code">logger(String name, Level level, List&lt;String> appenderNames = [], <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Boolean additivity = null)</span></h3>
+
+    <p>The <code>logger()</code> method takes four arguments, of which
+    the last two are optional. The first argument is the name of the
+    logger to configure. The second argument is the level of the
+    designated logger. Setting the level of a logger to
+    <code>null</code> forces it to <a
+    href="architecture.html#effectiveLevel">inherit its level</a> from
+    its nearest ancestor with an assigned level. The third argument of
+    type <code>List&lt;String></code> is optional and defaults to an
+    emtpy list if omitted. The appender names in the list are attached
+    to the designated logger. The forth argument of type
+    <code>Boolean</code> is also optional and controls the <a
+    href="architecture.html#additivity">additivity flag</a>. If
+    omitted, it defaults to <code>null</code>.
+    </p> 
+
+    <p>For example, the following script set the level of the
+    "com.foo" logger to INFO.</p>
+
+       <pre class="prettyprint">import static ch.qos.logback.classic.Level.INFO
+
+logger("com.foo", INFO)</pre>
+
+    <p>The next script sets the level of the "com.foo" logger to
+    DEBUG, and attaches the appender named "CONSOLE" to it.</p>
+
+  <pre class="prettyprint">import static ch.qos.logback.classic.Level.DEBUG
+
+logger("com.foo", DEBUG, ["CONSOLE"])</pre>
+    
+   <p>The next script is similiar to the previous one, except that it
+   also sets the the additivity flag of the "com.foo" logger to
+   false.</p>
+
+  <pre class="prettyprint">import static ch.qos.logback.classic.Level.DEBUG
+
+logger("com.foo", DEBUG, ["CONSOLE"], false)</pre>
+
+
+    <!-- ========================================================== -->
+    <h3>&#8226; <span class="code">appender(String name, Class clazz, Closure closure = null)</span></h3>
+
+    <p>The appender method takes the name of the appender being
+    configured as its first argument. The second mandatory argument is
+    the class of the appender to instantiate. The third argument is a
+    closure containing further configuration instructions. If omitted,
+    it defaults to null.</p>
+
+    <p>Most appenders require properties to be set and sub-components
+    to be injected to function properly. Properties are set using the
+    '=' operator (assignment). Sub-components are injected by invoking
+    a method named after the property and passing that method the
+    class to instantiate as an argument. This convention can be
+    applied recursively to configure properties as well as
+    sub-components of any appender sub-component. </p>
+    
+    <p>For example, the following script instantiates a
+    <code>FileAppender</code> named "FILE", setting its <span
+    class="option">file</span> property to "testFile.log" and its
+    <span class="option">append</span> property to false. An encoder
+    of type <code>PatternLayoutEncoder</code> is injected into the
+    appender. The pattern property of the encoder is set to "%level
+    %logger - %msg%n". The appender is then attached to the root
+    logger.</p>
+
+    <pre class="prettyprint">import ch.qos.logback.classic.encoder.PatternLayoutEncoder 
+import ch.qos.logback.core.FileAppender
+
+import static ch.qos.logback.classic.Level.DEBUG
+
+appender("FILE", FileAppender) {
+  file = "testFile.log"
+  append = true
+  encoder(PatternLayoutEncoder) {
+    pattern = "%level %logger - %msg%n"
+  }
+}
+
+root(DEBUG, ["FILE"])</pre>
+
+    <p>
+    </p>
+
+    
+  
+    <!-- ========================================================== -->        
+    <h3>&#8226; <span class="code">conversionRule(String conversionWord, Class converterClass)</span></h3>
+
+    <p>After creating your own <a
+    href="layouts.html#customConversionSpecifier">conversion
+    specifier</a>, you need to inform logback of its existence. Here
+    is a sample logback.groovy file which instructs logback to use
+    MySampleConverter whenever the <code>%sample</code> conversion
+    word is encountered.
+    </p>
+
+    <pre class="prettyprint">
+import ch.qos.logback.classic.encoder.PatternLayoutEncoder
+import ch.qos.logback.core.ConsoleAppender
+import chapters.layouts.MySampleConverter
+
+import static ch.qos.logback.classic.Level.DEBUG
+
+conversionRule("sample", MySampleConverter)
+appender("STDOUT", ConsoleAppender) {
+  encoder(PatternLayoutEncoder) {
+    pattern = "%-4relative [%thread] %<b>sample</b> - %msg%n"
+  }
+}
+root(DEBUG, ["STDOUT"])</pre>
+
+   <!-- ========================================================== -->
+   <h3>&#8226; <span class="code">scan(String scanPeriod = null)</span></h3>
 
     <p>Invoking the scan() method instructs logback to periodically
     scan the logback.groovy file for changes. Whenever a change is
-    detected, the logback.groovy file is reloaded.</p>
+    detected, the <em>logback.groovy</em> file is reloaded.</p>
 
-    <h3>statusListener(Class listenerClass)</h3>
-    
-    <h3>conversionRule(String conversionWord, Class converterClass)</h3>
+    <pre class="prettyprint">scan()</pre>
 
+    <p>By default, the configuration file will be scanned for changes
+    once every minute. You can specify a different scanning period by
+    passing a "scanPeriod" string value. Values can be specified in
+    units of milliseconds, seconds, minutes or hours. Here is an
+    example:
+    </p>
 
-    <h3> root(Level level, List<String> appenderNames = [])</String>
+    <pre class="prettyprint">scan("30 seconds")</pre>
+    
+    <p>If no unit of time is specified, then the unit of time is
+    assumed to be milliseconds, which is usually inappropriate. If you
+    change the default scanning period, do not forget to specify a
+    time unit. For additional details on how scanning works, please
+    refer to the <a href="configuration.html#autoScan">section on
+    automatic reloading</a>.
+    </p>
+    
+    <!-- ========================================================== -->
+  
+    <h3>&#8226; <span class="code">statusListener(Class listenerClass)</span></h3>
 
-    <h3>logger(String name, Level level, List<String> appenderNames = [], Boolean additivity = null)</String>
+    <p>You can add a status listener by invoking the
+    <code>statusListener</code> method and passing a listener class as
+    an argument. Here is an example:</p>
 
-    <h3>appender(String name, Class clazz, Closure closure = null)</h3>
+    <pre class="prettyprint">import ch.qos.logback.core.status.OnConsoleStatusListener
 
+statusListener(OnConsoleStatusListener)</pre>
+ 
+    <p><a href="configuration.html#statusListener">Status listeners</a> were described in an earlier
+    chapter.</p>
 
     <script src="../templates/footer.js" type="text/javascript"></script>
 

-----------------------------------------------------------------------

Summary of changes:
 ...nfigurator.groovy => GafferConfigurator.groovy} |   16 ++-
 .../qos/logback/classic/jmx/JMXConfigurator.java   |    2 +-
 .../logback/classic/util/ContextInitializer.java   |   68 +++++--
 .../ch/qos/logback/classic/util/EnvUtil.java}      |   20 +-
 ...orTest.groovy => GafferConfiguratorTest.groovy} |    4 +-
 .../classic/sift/GSiftingAppenderTest.groovy       |    4 +-
 logback-site/src/site/pages/css/common.css         |    3 +-
 .../src/site/pages/manual/architecture.html        |    2 +-
 logback-site/src/site/pages/manual/groovy.html     |  224 +++++++++++++++++---
 9 files changed, 277 insertions(+), 66 deletions(-)
 rename logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/{Configurator.groovy => GafferConfigurator.groovy} (80%)
 copy logback-classic/src/main/{groovy/ch/qos/logback/classic/gaffer/AppenderDelegate.groovy => java/ch/qos/logback/classic/util/EnvUtil.java} (59%)
 rename logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/{ConfiguratorTest.groovy => GafferConfiguratorTest.groovy} (98%)


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list