king-tyler commented on code in PR #3226:
URL: https://github.com/apache/logging-log4j2/pull/3226#discussion_r1852295422


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java:
##########
@@ -506,9 +506,16 @@ public synchronized void rollover() {
 
             if (rollover(rolloverStrategy)) {
                 try {
-                    size = 0;
-                    initialTime = System.currentTimeMillis();
                     createFileAfterRollover();
+                    final File file = new File(getFileName());
+                    size = file.length();
+                    try {
+                        final FileTime creationTime = (FileTime) 
Files.getAttribute(file.toPath(), "creationTime");
+                        initialTime = creationTime.toMillis();
+                    } catch (Exception ex) {
+                        LOGGER.warn("Unable to get current file time for {}", 
file);
+                        initialTime = System.currentTimeMillis();
+                    }

Review Comment:
   I've made these changes; note that this required a change to the 
`testSynchronousActionFailure` test



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to