[
https://issues.apache.org/jira/browse/LOG4J2-758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17520591#comment-17520591
]
Tilman Hausherr commented on LOG4J2-758:
----------------------------------------
It's not fixed... but the explanation in LOG4J2-2602 makes me suspect that it
"works as intended", and that it is a duplicate.
> 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
(v8.20.1#820001)