You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2022/01/15 13:37:55 UTC

[GitHub] [logging-log4j2] strugerk commented on a change in pull request #703: fix deleteAction can't distinguish basePath of symbolicLink

strugerk commented on a change in pull request #703:
URL: https://github.com/apache/logging-log4j2/pull/703#discussion_r785308866



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/AbstractPathAction.java
##########
@@ -103,7 +103,15 @@ public boolean execute(final FileVisitor<Path> visitor) throws IOException {
      * @return the base path (all lookups resolved)
      */
     public Path getBasePath() {
-        return Paths.get(subst.replace(getBasePathString()));
+        Path path = Paths.get(subst.replace(getBasePathString()));
+        if (Files.isSymbolicLink(path)) {
+            try {
+                path = Files.readSymbolicLink(path);
+            } catch (IOException e) {
+                e.printStackTrace();

Review comment:
       ok, I think we should throw out the exception.  
   It's necessary to capture the exception , because this IOException has been caught outside.
   The status logger can also be printed when handling exceptions externally




-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org