Docs Menu
Docs Home
/
MongoDB Shell
/ /

Log Retention

On this page

  • Get Started
  • Details

You can customize how MongoDB Shell logs are retained. By default, the system retains 100 log files for 30 days. You can choose to retain logs based on a combination of time, storage size, and number of log files.

To customize log retention, see these pages:

  • Modify Log Retention Duration

  • Modify Maximum Log Storage Size

  • Modify Maximum Log File Count

You can specify multiple criteria for log retention. For example, you can specify a maximum duration for log files of 60 days and a maximum log storage size of 2GB. Logs are deleted when any retention criterion is met, starting with the oldest logs.

Back

Write Custom Log Entries

On this page