Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13493

support interoperability with Linux logrotate

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Logging
    • Labels:

      Currently mongod doesn't work completely satisfactorily with Linux logrotate.The standard method of allowing logrotate to rename the file doesn't work because mongod continues writing to the open fd of the renamed file instead of to the new file. You can use the "copytruncate" option which causes logrotate to copy the current log file to the rotated file and then truncate the current log file to delete the old entries, but this a) requires that the file be copied instead of just renaming it and b) loses any log entries made between the copy and the truncate.

      This could be fixed if there were some way to force mongod to close the current log file and open it again. Ideally this would be a signal (to simplify using it in a logrotate script), possibly SIGUSR1 with alternate semantics specified by a configuration option.

            Unassigned Unassigned
            bruce.lucas@mongodb.com Bruce Lucas (Inactive)
            0 Vote for this issue
            5 Start watching this issue