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

automatically rotate mongo logs on a schedule or size threshold

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.4
    • Fix Version/s: None
    • Component/s: Logging
    • Labels:
    • Environment:
      Unix

      Description

      Automatic rotation for mongodb.log should be done based on size, and the number of backups retained should be capped at a configurable limit. Reasonable defaults might be 20MB size and 3 backups. That way the total disk space used to keep log files will have a configured maximum.

      Suggested example syntax for /etc/mongodb.conf:
      logpath=/var/log/mongo/mongodb.log
      logrotatesize=20M
      logrotatebackups=3

      I have filed this as Major priority because it can impact a running server as a secondary problem. Due to an unrelated issue my Mongo server started logging the same error message repeatedly and quickly filled up its filesystem. Had this feature been in place, with size-based rotation and a fixed number of backups, the filesystem would not have filled up.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                30 Vote for this issue
                Watchers:
                26 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: