
Author: ceki Date: Thu Aug 6 08:57:27 2009 New Revision: 2414 Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFNATP.java logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/FileNamePattern.java Log: ongoing work Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFNATP.java ============================================================================== --- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFNATP.java (original) +++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFNATP.java Thu Aug 6 08:57:27 2009 @@ -25,7 +25,17 @@ @Override public void start() { + // we actualy depend on fields being initialized + // in super.start() super.start(); + + // we need to get the correct value of currentPeriodsCounter. + // usually the value is 0, unless the appender or the application + // is stopped and restarted within the same period + + String regex = tbrp.fileNamePattern.asRegex(dateInCurrentPeriod); + continueHere + started = true; } Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/FileNamePattern.java ============================================================================== --- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/FileNamePattern.java (original) +++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/FileNamePattern.java Thu Aug 6 08:57:27 2009 @@ -140,8 +140,10 @@ return pattern; } - // Given date, convert this instance to a regular expression - String asRegex(Date date) { + /** + * Given date, convert this instance to a regular expression + */ + public String asRegex(Date date) { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { @@ -157,8 +159,10 @@ return buf.toString(); } - // Given date, convert this instance to a regular expression - String asRegex() { + /** + * Given date, convert this instance to a regular expression + */ + public String asRegex() { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) {