[
https://issues.apache.org/jira/browse/LOG4J2-2769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17042753#comment-17042753
]
ASF subversion and git services commented on LOG4J2-2769:
---------------------------------------------------------
Commit 1bfe1522a617e47515a28727f57382e0a28c4662 in logging-log4j2's branch
refs/heads/master from Ralph Goers
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=1bfe152 ]
LOG4J2-2769 - Do not log an error if Files.move does not work.
> AtomicMoveNotSupportedException shouldn't be logged as ERROR
> ------------------------------------------------------------
>
> Key: LOG4J2-2769
> URL: https://issues.apache.org/jira/browse/LOG4J2-2769
> Project: Log4j 2
> Issue Type: Improvement
> Components: Appenders
> Affects Versions: 2.13.0
> Reporter: Andrey Turbanov
> Priority: Minor
> Fix For: 2.13.1
>
>
> When RollingFileAppender moves file to another folder, it tries to use
> [ATOMIC_MOVE|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/StandardCopyOption.html#ATOMIC_MOVE]
> option as most strong one approach.
> In many common production cases this approach *always* fails, and
> {{RollingFileAppender}} fallbacks (which is good) to use
> [File.renameTo|https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/File.html#renameTo(java.io.File)]
> method. One of such common case - using network filesystem for _cold_ logs
> (E.g. CIFS).
> When atomic move fails it prints error to the log. Something like this:
> {code}
> ERROR Unable to move file /opt/log/console.60465.pp1.log to
> /opt/case/20200130/console.60465.pp1.20200130_193421.log:
> java.nio.file.AtomicMoveNotSupportedException /opt/log/console.60465.pp1.log
> -> /opt/case/20200130/console.60465.pp1.20200130_193421.log: Invalid
> cross-device link
> {code}
> Such logs are very distracting and can lead to unnecessary monitoring alerts.
> I suggest to lower logging level for such case to INFO or WARN. As it's
> *expected* scenario.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)