Docs Home / mongosh / Reference / Logs

Log Retention日志保留

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.您可以自定义MongoDB Shell日志的保留方式。默认情况下,系统保留100个日志文件30天。您可以选择根据时间、存储大小和日志文件数量的组合来保留日志。

Get Started开始使用

To customize log retention, see these pages:要自定义日志保留,请参阅以下页面:

Details详情

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.您可以为日志保留指定多个条件。例如,您可以指定日志文件的最长持续时间为60天,最大日志存储大小为2GB。当满足任何保留标准时,日志将被删除,从最旧的日志开始。