You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2012/06/14 21:30:57 UTC

[Bug 53417] New: Extras TimeBasedRollingPolicy does not compress log files

https://issues.apache.org/bugzilla/show_bug.cgi?id=53417

          Priority: P2
            Bug ID: 53417
                CC: log4j-dev@logging.apache.org
          Assignee: log4j-dev@logging.apache.org
           Summary: Extras TimeBasedRollingPolicy does not compress log
                    files
          Severity: normal
    Classification: Unclassified
          Reporter: krisztian.kocsis@optimaster.eu
          Hardware: PC
            Status: NEW
           Version: 1.2
         Component: Companions
           Product: Log4j

The TimeBasedRollingPolicy does not compress log files with the following file
name pattern: "C:\Test\Logs\%d.log.zip"

Example:

On 2012-06-12 this file is created: C:\Test\Logs\2012-06-12.log
On 2012-06-14 this file is created: C:\Test\Logs\2012-06-14.log

Unfortunately the 2012-06-12.log didn't get compressed.
Note that the application didn't run at midnight.

Here is how the I initialize the logger:

    final org.apache.log4j.Logger rootLogger =
org.apache.log4j.Logger.getRootLogger();

    rootLogger.getLoggerRepository().resetConfiguration();
    rootLogger.setLevel(useDebugLog ? Level.DEBUG : Level.INFO);

    final PatternLayout          commonPatternLayout      = new
PatternLayout("%d{ISO8601} [%t] (%c) %p - %m%n");
    final TimeBasedRollingPolicy dailyRollingFilePolicy   = new
TimeBasedRollingPolicy();
    final RollingFileAppender    dailyRollingFileAppender = new
RollingFileAppender();

    dailyRollingFilePolicy.setFileNamePattern("C:\Test\Logs\%d.log.zip");
    dailyRollingFilePolicy.activateOptions();

    dailyRollingFileAppender.setEncoding("UTF-8");
    dailyRollingFileAppender.setLayout(commonPatternLayout);
    dailyRollingFileAppender.setRollingPolicy(dailyRollingFilePolicy);
    dailyRollingFileAppender.activateOptions();

    rootLogger.addAppender(dailyRollingFileAppender);

Log4J: 1.2.17, extras: 1.1, Java 7u4

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[Bug 53417] Extras TimeBasedRollingPolicy does not compress log files

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53417

grobmeier <gr...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from grobmeier <gr...@gmail.com> ---
This issue is tied due to the interrupt problem of the GZ compressor as
decribed in 51152

*** This bug has been marked as a duplicate of bug 51152 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org