Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 63EA8104C5 for ; Sun, 9 Feb 2014 20:35:26 +0000 (UTC) Received: (qmail 2170 invoked by uid 500); 9 Feb 2014 20:35:21 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 2082 invoked by uid 500); 9 Feb 2014 20:35:21 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 2068 invoked by uid 99); 9 Feb 2014 20:35:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Feb 2014 20:35:21 +0000 Date: Sun, 9 Feb 2014 20:35:21 +0000 (UTC) From: "Remko Popma (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-531) Rolled log files overwritten by RollingFile appender with composite time and size based policies MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13896026#comment-13896026 ] Remko Popma commented on LOG4J2-531: ------------------------------------ I will add JUnit tests for this ASAP. Probably one day from now. Sorry but I won't be able to do it sooner. > Rolled log files overwritten by RollingFile appender with composite time and size based policies > ------------------------------------------------------------------------------------------------ > > Key: LOG4J2-531 > URL: https://issues.apache.org/jira/browse/LOG4J2-531 > Project: Log4j 2 > Issue Type: Bug > Components: Appenders > Affects Versions: 2.0-beta9 > Environment: Ubuntu 12.04 and 13.04, java version "1.7.0_51" > Reporter: Geoff Ballinger > Assignee: Remko Popma > Fix For: 2.0-rc1 > > > We have a system which generates high volume logs which are required to be preserved for audit purposes, and have been having problems with files being unexpectedly overwritten. > We are using a RollingFile appender with day granularity, time based and size based triggering policies, and a rollover strategy with a suitably large max value. > I have created a simple test case with minute granularity to quickly illustrate the problem, which is v. similar to the example given in the documentation: > {noformat} > import org.apache.logging.log4j.LogManager; > import org.apache.logging.log4j.Logger; > public class LogTest > { > private static final Logger logger = LogManager.getLogger("TestLogger"); > public static void main(String[] args) throws Exception > { > for (long i=0; ; i+=1) { > logger.debug("Sequence: " + i); > Thread.sleep(250); > } > } > } > {noformat} > ... with a config of: > {noformat} > > > > > > > > > > > > > > > > > > > {noformat} > If this is run as is many of the rollover logfiles have other files written over them and are lost, as can clearly be seen by the gaps in the remaining sequence numbers, and the order the sequence numbers appear in the resulting files. > If the time based policy is removed from the config and it is re-run then all sequence numbers are correctly stored and in the expected order., Without the time based trigger some are carried over into the folder for the next period which is not ideal, though is what we are using at present to avoid data loss. -- This message was sent by Atlassian JIRA (v6.1.5#6160) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org