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

No compression when using a separate drive in Linux

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.9.0
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Unix

      Description

      When setting up the filePattern of a RollingFileAppender pointing to a different FS than the fileName, the file gets moved but not compressed:

      In this example, /usr/local and /archives are not on the same FS:

      2017-08-11 14:34:33,632 pool-8-thread-1 TRACE DefaultRolloverStrategy.purge() took 15.0 milliseconds 
      2017-08-11 14:34:33,643 pool-8-thread-1 DEBUG RollingFileManager executing synchronous FileRenameAction[/usr/local/app/logs/app.log to /archives/logs/app-2017-08-11_14-34-33.log, renameEmptyFiles=false] 
      2017-08-11 14:34:33,646 pool-8-thread-1 ERROR Unable to move file /usr/local/app/logs/app.log to /archives/logs/app-2017-08-11_14-34-33.log: java.nio.file.AtomicMoveNotSupportedException /usr/local/app/logs/app.log -> /archives/logs/app-2017-08-11_14-34-33.log: Invalid cross-device link 
      2017-08-11 14:34:33,736 pool-8-thread-1 TRACE Renamed file /usr/local/app/logs/app.log to /archives/logs/app-2017-08-11_14-34-33.log using copy and delete

      Also reported here:
      https://stackoverflow.com/questions/43179979/log4j2-rollingfileappender-invalid-cross-device-link

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                benjamin.jaton Benjamin Jaton
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: