-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Packaging
-
None
MongoDB includes it's own log-rotation mechanism (http://docs.mongodb.org/manual/tutorial/rotate-log-files/).
However, there is also a Linux package, logrotate, which is very commonly used. It comes installed by default on most common Linux distributions (including both Ubuntu and RHEL-distros), and many server applications will include logrotate scripts.
Logrotate also handles things that the rather simple MongoDB log-rotation mechanism does not such as archiving of old logfiles, and compression of logfiles.
There are many posts online on how to use logrotate with MongoDB.:
- http://serverfault.com/questions/540423/mongodb-proper-way-to-rotate-logs
- http://stackoverflow.com/questions/5004626/mongodb-log-file-growth/
However, there are quite a few rough edges and ways to shoot yourself in the foot.
There is also some discussion around it on SERVER-11087, where a MongoDB engineer happens to provide a sample script.
It would be nice if the official MongoDB packages also included a suitable logrotate script that could either be used out of the box, or used as a base to developer your own logrotate scripts.
- duplicates
-
SERVER-1865 Official Linux packages don't set up logrotate
- Closed