https://issues.apache.org/bugzilla/show_bug.cgi?id=53417
Priority: P2
Bug ID: 53417
CC: [email protected]
Assignee: [email protected]
Summary: Extras TimeBasedRollingPolicy does not compress log
files
Severity: normal
Classification: Unclassified
Reporter: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]