logging-log4j-dev mailing list archives

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

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

Pierrick HYMBERT commented on LOG4J2-1480:

I accidentally created a cloned jira in LOG4J2-1548. Attached unit test and fix there.

> 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

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

View raw message