Details
-
Task
-
Resolution: Won't Do
-
Major - P3
-
None
Description
Description
It is fairly common for users to wish for more advanced log rotation. For example:
- Automatically rotating the logs at time intervals, e.g. at 00:00:00 every Monday
- Automatically rotating the logs when they reach a certain size, e.g. 250MB
Rather than re-implement these features directly in MongoDB, we have chosen instead to implement work that allows us to integrate well with the de-facto standard and ubiquitous system tooling – the logrotate project – which is available on Linux, macOS, and Windows. (See SERVER-18335)
We have documentation on how to do manual rotations using the built-in features here: https://docs.mongodb.com/manual/tutorial/rotate-log-files/
We should build on that and demonstrate how those underlying features allow us to easily integrate with LogRotate and show examples of how to implement some common requests for MongoDB log files, such as those noted above.
Some related documentation can be seen here:
- https://www.digitalocean.com/community/tutorials/how-to-manage-logfiles-with-logrotate-on-ubuntu-16-04
- https://support.rackspace.com/how-to/sample-logrotate-configuration-and-troubleshooting/
- https://www.linode.com/docs/uptime/logs/use-logrotate-to-manage-log-files/
- https://www.tecmint.com/install-logrotate-to-manage-log-rotation-in-linux/
Scope of changes
- Test and document using logrotate on Ubuntu 18.04, 16.04, 14.04
- Test and document using logrotate on Windows Server 2008/2012
- Test and document using logrotate on OSX
- Document procedure and backport to 3.4 (modify existing log rotation documentation to reference logrotate utility with prominent admonition / disclaimer given third-party tech
Attachments
Issue Links
- is depended on by
-
SERVER-18335 Automatically run logRotate after log file reaches specified size
-
- Closed
-