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

automatically rotate mongo logs on a schedule or size threshold

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • 1.8.4
    • None
    • Logging
    • 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

              Unassigned Unassigned
              wberry Will Berry
              Votes:
              30 Vote for this issue
              Watchers:
              26 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: