ppkarwasz commented on code in PR #3855:
URL: https://github.com/apache/logging-log4j2/pull/3855#discussion_r2465296809


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java:
##########
@@ -343,6 +344,16 @@ protected synchronized void writeToDestination(final 
byte[] bytes, final int off
     public String getFileName() {
         return getName();
     }
+
+    /**
+     * Returns the Path of the file being managed.
+     * @return The name of the file being managed.
+     * @since 2.26.0
+     */
+    public Path getPath() {

Review Comment:
   A small naming suggestion: since we already have a `getFileName()` method, 
it might be clearer to name this new method `getFilePath()` instead of 
`getPath()`.
   
   It would also help to document the expected characteristics of the returned 
`Path`, for example:
   
   * Whether the returned path is **absolute** and **normalized**. Since 
multiple appenders (even across different logger contexts) may share a single 
`FileManager`, using an absolute, normalized `Path` avoids ambiguity and makes 
comparisons safer.
   * Whether the value may **change over time**. In particular, 
`RollingFileManager` can update its active file during rollover (especially 
with the *DirectWriteRolloverStrategy*), so it would be useful to document that 
the returned path may not be stable across invocations.
   



-- 
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