[
https://issues.apache.org/jira/browse/LOG4J2-2562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16784125#comment-16784125
]
finalmachine commented on LOG4J2-2562:
--------------------------------------
I test more code. I find the app.log create time is error when change windows
time by gui then use code "new FileOutputStream()"
I test three jdk
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
> RollingFileManager create wrong file name with TimeBasedTriggeringPolicy
> ------------------------------------------------------------------------
>
> Key: LOG4J2-2562
> URL: https://issues.apache.org/jira/browse/LOG4J2-2562
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.11.2
> Environment: windows 7 x64
> java 11 openjdk x64
> Reporter: finalmachine
> Priority: Major
> Labels: patch
> Attachments: log4j2.xml
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> because of the app.log file is never delete, app.log file create time never
> change.
> first day all log write in app.log
> second day app.log content copy to app-first day.log, second day log write in
> app.log
> third day app.log content copy to app-{color:#FF0000}first day{color}.log,
> third day log write in app.log
> debug the code AbstractRolloverStrategy#getEligibleFiles:91 call
> PatternProcessor#formatFileName:257 create file use prevFileTime
> prevFileTime is set at RollingFileManager#initialFileTime:683 use file
> creationTime.
> I think third day app.log content should copy to app-{color:#FF0000}second
> day{color}.log. the code should delete app.log file then create file or use
> app.log last modify time
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)