You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2019/06/23 08:05:00 UTC
[jira] [Commented] (LOG4J2-758) Log file getting overwritten when
using both OnStartupTriggeringPolicy and TimeBasedTriggeringPolicy.
[ https://issues.apache.org/jira/browse/LOG4J2-758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16870479#comment-16870479 ]
Ralph Goers commented on LOG4J2-758:
------------------------------------
After almost 5 years I am pretty sure this must have been fixed. Please try with the latest release.
> Log file getting overwritten when using both OnStartupTriggeringPolicy and TimeBasedTriggeringPolicy.
> -----------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-758
> URL: https://issues.apache.org/jira/browse/LOG4J2-758
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders, Configurators, Core
> Affects Versions: 2.0
> Environment: MAC, Eclipse, Java
> Reporter: Parkirat Singh Bagga
> Priority: Major
> Labels: build, features
> Attachments: log4j2.xml
>
>
> I am using Rolling File Appender with the Log4j2 2.0 version jar.
> Now when I use both OnStartupTriggeringPolicy and TimeBasedTriggeringPolicy set with the interval 3 minutes and use the OnStartupTriggeringPolicy policy to roll at the server restart.
> Now if, my file pattern has only date pattern set (%d{yyyy-MM-dd-HH-mm}) and not %i, and I restart the server more than 3-4 times, the policy rolls the
> file to future time and when the TimeBasedTriggeringPolicy tries to roll the
> file, those files are already present due to rollover by restarting the server many times and that earlier log file gets overwritten.
> This leads to loss of the logging thus I think OnStartupTriggeringPolicy
> policy when does a rollover, should add the currentTimeMillis to the log
> file name as well.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)