logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefano Ongeri (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1480) CronTriggeringPolicy timing / file deletion issue
Date Wed, 03 Aug 2016 12:12:20 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15405822#comment-15405822
] 

Stefano Ongeri commented on LOG4J2-1480:
----------------------------------------

I'm experiencing the same issue in one of my projects. The rollover goes berker after the
first trigger by any cron expression, mine was originally at midnight but i tried changing
it to 1 minute to debug the problem and it instantly reproduced the behaviour.
I've solved the problem going back from version 2.6.2 to 2.6.1 ( we previously used 2.6.1
already and it was fine).

> CronTriggeringPolicy timing / file deletion issue
> -------------------------------------------------
>
>                 Key: LOG4J2-1480
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1480
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.6.2
>         Environment: 2013 macbook pro running OSX El Capitan. Log4j2 is running as a
module dependency to a bigger Vertx server project.
>            Reporter: matthew beckham
>
> Most of this issue is outlined in this stack overflow post: http://stackoverflow.com/questions/38514101/log4j2-default-rollover-strategy-deleting-new-log-files
> This details my attempt to use the CronTriggeringPolicy to rollover a log file. My longterm
goal was to have it roll over every 15 minutes, but used 1 minutes intervals for testing (I
did also try with 3 and 5 minute intervals with the same outcome).
> The gist of the issue is that after the first triggering of the cron triggering policy
(which happens at the correct time), the rollover mechanism will disregard the cron schedule
in place and attempt to rollover every second. In addition to this, the log file that is created
from a rollover can be deleted immediately after it is created. The log file appears to not
get deleted if there is a iterator argument (%i) in the file name though.
> I don't know if these are two separate issues, or if the file deletion is a side effect
of the cron scheduling getting messed up.
> For now I have switched to using TimeBasedTriggeringPolicy and that appears to be working
correctly at the moment.
> Logs and sample configuration code can be found in the linked stack overflow post.



--
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


Mime
View raw message