Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2769

AtomicMoveNotSupportedException shouldn't be logged as ERROR

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.13.0
    • Fix Version/s: 2.13.1
    • Component/s: Appenders
    • Labels:
      None

      Description

      When RollingFileAppender moves file to another folder, it tries to use 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 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:

      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
      

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                turbanoff Andrey Turbanov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: