[logback-dev] svn commit: r748 - logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling

noreply.seb at qos.ch noreply.seb at qos.ch
Mon Oct 23 20:56:23 CEST 2006


Author: seb
Date: Mon Oct 23 20:56:22 2006
New Revision: 748

Modified:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/FixedWindowRollingPolicy.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingPolicyBase.java

Log:
fooling around

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/FixedWindowRollingPolicy.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/FixedWindowRollingPolicy.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/FixedWindowRollingPolicy.java	Mon Oct 23 20:56:22 2006
@@ -67,7 +67,6 @@
   public FixedWindowRollingPolicy() {
     minIndex = 1;
     maxIndex = 7;
-    activeFileName = null;
   }
 
   public void start() {

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java	Mon Oct 23 20:56:22 2006
@@ -60,7 +60,7 @@
  * @since  1.3
  * */
 public class RollingFileAppender extends FileAppender {
-  File activeFile;
+  File activeFileCache;
   TriggeringPolicy triggeringPolicy;
   RollingPolicy rollingPolicy;
 
@@ -80,12 +80,11 @@
 
     if (rollingPolicy != null) {
       String afn = rollingPolicy.getActiveFileName();
-      activeFile = new File(afn);
+      // the activeFile variable is used by the triggeringPolicy.isTriggeringEvent method
+      activeFileCache = new File(afn);
       addInfo("Active log file name: "+afn);
       setFile(afn);
-      
-      // the activeFile variable is used by the triggeringPolicy.isTriggeringEvent method
-      activeFile = new File(afn);
+
       super.start();
     } else {
       addWarn("No RollingPolicy was set for the RollingFileAppender named "+ getName());
@@ -132,7 +131,7 @@
     addInfo("Active file name is now ["+ fileName+"].");
 
     // the activeFile variable is used by the triggeringPolicy.isTriggeringEvent method
-    activeFile = new File(fileName);
+    ////activeFile = new File(fileName);
 
     try {
       // This will also close the file. This is OK since multiple
@@ -151,7 +150,7 @@
   protected void subAppend(Object event) {
     // The roll-over check must precede actual writing. This is the 
     // only correct behavior for time driven triggers. 
-    if (triggeringPolicy.isTriggeringEvent(activeFile, event)) {
+    if (triggeringPolicy.isTriggeringEvent(activeFileCache, event)) {
       rollover();
     }
       

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingPolicyBase.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingPolicyBase.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingPolicyBase.java	Mon Oct 23 20:56:22 2006
@@ -26,7 +26,7 @@
   protected int compressionMode = Compress.NONE;
   protected FileNamePattern fileNamePattern;
   protected String fileNamePatternStr;
-  protected String activeFileName;
+  protected String activeFileName = null;
 
   private boolean started;
   



More information about the logback-dev mailing list