[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.25-22-ga0242c2

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Fri Nov 5 18:19:07 CET 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  a0242c2da3c940e139d43438c04046a2f11676e6 (commit)
      from  c256b231bf79b9518333cf56d77d48944a8d3b9c (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=a0242c2da3c940e139d43438c04046a2f11676e6
http://github.com/ceki/logback/commit/a0242c2da3c940e139d43438c04046a2f11676e6

commit a0242c2da3c940e139d43438c04046a2f11676e6
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Fri Nov 5 18:11:50 2010 +0100

    Fix LBCLASSIC-231

diff --git a/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/ComponentDelegate.groovy b/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/ComponentDelegate.groovy
index b4e01b7..6cfdf38 100644
--- a/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/ComponentDelegate.groovy
+++ b/logback-classic/src/main/groovy/ch/qos/logback/classic/gaffer/ComponentDelegate.groovy
@@ -16,7 +16,7 @@ package ch.qos.logback.classic.gaffer
 import ch.qos.logback.core.spi.ContextAwareBase
 import ch.qos.logback.core.spi.LifeCycle
 import ch.qos.logback.core.spi.ContextAware
-import java.beans.Introspector
+import ch.qos.logback.core.joran.spi.NoAutoStartUtil
 
 /**
  * @author Ceki G&uuml;c&uuml;
@@ -64,7 +64,7 @@ class ComponentDelegate extends ContextAwareBase {
         closure.resolveStrategy = Closure.DELEGATE_FIRST
         closure()
       }
-      if (subComponent instanceof LifeCycle) {
+      if (subComponent instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(subComponent)) {
         subComponent.start();
       }
       PropertyUtil.attach(nestingType, component, subComponent, name)
diff --git a/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfigurationDelegateTest.groovy b/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfigurationDelegateTest.groovy
index b923433..ea94697 100644
--- a/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfigurationDelegateTest.groovy
+++ b/logback-classic/src/test/groovy/ch/qos/logback/classic/gaffer/ConfigurationDelegateTest.groovy
@@ -21,6 +21,7 @@ import ch.qos.logback.core.rolling.RollingFileAppender
 import ch.qos.logback.core.rolling.TimeBasedRollingPolicy
 import ch.qos.logback.classic.encoder.PatternLayoutEncoder
 import ch.qos.logback.core.util.CoreTestConstants
+import ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP
 
 /**
  * @author Ceki G&uuml;c&uuml;
@@ -196,12 +197,12 @@ class ConfigurationDelegateTest {
   @Test
   void appenderRolling() {
 
-    String logFile = randomOutputDir+"log.txt";
+    String logFile = randomOutputDir + "log.txt";
 
     configurationDelegate.appender("ROLLING", RollingFileAppender) {
       file = logFile
       rollingPolicy(TimeBasedRollingPolicy) {
-        fileNamePattern = randomOutputDir+"log.%d{yyyy-MM}.log.zip"
+        fileNamePattern = randomOutputDir + "log.%d{yyyy-MM}.log.zip"
       }
       encoder(PatternLayoutEncoder) {
         pattern = '%msg%n'
@@ -212,4 +213,27 @@ class ConfigurationDelegateTest {
     assertNotNull(back)
     assertEquals(logFile, back.rollingPolicy.getParentsRawFileProperty())
   }
+
+
+  // See LBCLASSIC-231
+  @Test
+  void withSizeAndTimeBasedFNATP() {
+    String logFile = randomOutputDir + "log.txt";
+    configurationDelegate.appender("ROLLING", RollingFileAppender) {
+      file = logFile
+      rollingPolicy(TimeBasedRollingPolicy) {
+        fileNamePattern = "mylog-%d{yyyy-MM-dd}.%i.txt"
+        timeBasedFileNamingAndTriggeringPolicy(SizeAndTimeBasedFNATP) {
+          maxFileSize = "100MB"
+        }
+      }
+      encoder(PatternLayoutEncoder) {
+        pattern = "%msg%n"
+      }
+    }
+    RollingFileAppender back = configurationDelegate.appenderList.find {it.name = "ROLLING"}
+    assertNotNull(back)
+    assertEquals(logFile, back.rollingPolicy.getParentsRawFileProperty())
+    assertTrue(back.rollingPolicy.timeBasedFileNamingAndTriggeringPolicy.isStarted())
+  }
 }
diff --git a/logback-examples/src/main/java/chapters/appenders/conf/logbback-sizeAndTime.xml b/logback-examples/src/main/java/chapters/appenders/conf/logback-sizeAndTime.xml
similarity index 90%
rename from logback-examples/src/main/java/chapters/appenders/conf/logbback-sizeAndTime.xml
rename to logback-examples/src/main/java/chapters/appenders/conf/logback-sizeAndTime.xml
index 505cd9c..1549c41 100644
--- a/logback-examples/src/main/java/chapters/appenders/conf/logbback-sizeAndTime.xml
+++ b/logback-examples/src/main/java/chapters/appenders/conf/logback-sizeAndTime.xml
@@ -1,5 +1,7 @@
 <configuration>
 
+  <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
+
   <appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
     <file>mylog.txt</file>
     <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

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

Summary of changes:
 .../classic/gaffer/ComponentDelegate.groovy        |    4 +-
 .../gaffer/ConfigurationDelegateTest.groovy        |   28 ++++++++++++++++++-
 ...ack-sizeAndTime.xml => logback-sizeAndTime.xml} |    2 +
 3 files changed, 30 insertions(+), 4 deletions(-)
 rename logback-examples/src/main/java/chapters/appenders/conf/{logbback-sizeAndTime.xml => logback-sizeAndTime.xml} (90%)


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


More information about the logback-dev mailing list