Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9F3BF200B5C for ; Thu, 28 Jul 2016 05:47:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9DD03160A90; Thu, 28 Jul 2016 03:47:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D61F2160AA8 for ; Thu, 28 Jul 2016 05:47:21 +0200 (CEST) Received: (qmail 23166 invoked by uid 500); 28 Jul 2016 03:47:20 -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 23133 invoked by uid 99); 28 Jul 2016 03:47:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2016 03:47:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7F78A2C0D5D for ; Thu, 28 Jul 2016 03:47:20 +0000 (UTC) Date: Thu, 28 Jul 2016 03:47:20 +0000 (UTC) From: "yin mingjun (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (LOG4J2-1486) when rolling target file exist, RollingFileManager would remove target log file and fail rollover log file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 28 Jul 2016 03:47:22 -0000 yin mingjun created LOG4J2-1486: ----------------------------------- Summary: when rolling target file exist, RollingFileManager would remove target log file and fail rollover log file Key: LOG4J2-1486 URL: https://issues.apache.org/jira/browse/LOG4J2-1486 Project: Log4j 2 Issue Type: Bug Components: Core Affects Versions: 2.6.2 Environment: mac osx capiton/jvm 1.7/log4j2 2.6.2 Reporter: yin mingjun I create two file, one is testcmd.log, other is testcmd.log.2016-07-24 then, I touch the testcmd.log's modified time: {{touch -t 1607240101 testcmd.log}} and I write some code like this: {code} @Test public void testRollingFileManager() { TriggeringPolicy triggerPolicy = TimeBasedTriggeringPolicy.createPolicy("1", "true"); DefaultRolloverStrategy rolloverStrategy = DefaultRolloverStrategy.createStrategy("7", "1", "max", null, null, false, new NullConfiguration()); RollingFileManager fileManager = RollingFileManager.getFileManager("testcmd.log", "testcmd.log.%d{yyyy-MM-dd}", true, true, triggerPolicy, rolloverStrategy, null, PatternLayout.createDefaultLayout(), 0, true); //trigger rollover fileManager.rollover(); } {code} I run this code, find that testcmd.log.2016-07-24 is disappear !!! I think the file pattern dos't contain "%i", the purge process can be ignored (the file is removed during purge operation). And the other advise is, IF the destination file is already exists, we should just ignore the rolling over operation. Anyway, the lost of a log file has more harms for us. thanks. yin mingjun -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org