[
https://issues.apache.org/jira/browse/LOG4J2-758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Parkirat Singh Bagga updated LOG4J2-758:
----------------------------------------
Attachment: log4j2.xml
Attached the log4j configuration of my app.
> 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
> 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
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]