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

automatically rotate mongo logs on a schedule or size threshold

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

      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.

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

              Created:
              Updated:
              Resolved: