This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch 2.25.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/2.25.x by this push:
     new 5184c99c5d Bring more fixes to `RollingFileManager`
5184c99c5d is described below

commit 5184c99c5d2d29dc239f9e3f3c83c373bb6ff885
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Wed Jul 1 11:46:31 2026 +0200

    Bring more fixes to `RollingFileManager`
---
 .../log4j/core/appender/rolling/RollingFileManager.java        | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java
index 7ec33c9f73..0c62bfac96 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java
@@ -394,12 +394,10 @@ public class RollingFileManager extends FileManager {
 
     @Override
     protected void createParentDir(File file) {
-        if (directWrite) {
-            final File parent = file.getParentFile();
-            // If the parent is null the file is in the current working 
directory.
-            if (parent != null) {
-                parent.mkdirs();
-            }
+        try {
+            FileUtils.makeParentDirs(file);
+        } catch (IOException e) {
+            LOGGER.error("Unable to create parent directories for file {}", 
file, e);
         }
     }
 

Reply via email to