[SERVER-7312] Automatic rolling of log files Created: 10/Oct/12  Updated: 31/Jul/15  Resolved: 10/Jun/14

Status: Closed
Project: Core Server
Component/s: Logging
Affects Version/s: 2.2.0
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: René M. Andersen Assignee: Unassigned
Resolution: Done Votes: 0
Labels: polish
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows


Issue Links:
Depends
depends on SERVER-4905 logRotate should conform to standard ... Closed
Participants:

 Description   

Our product ships with MongoDB and the user has no administrators to handle roling of log files etc. This means all maintenance has to be handled by our product.

It would be a lot easier of MongoDB supports automatic rolling of log files based on date or file size etc. instead of us having to set up a scheduled task programmatically when installing.

It is related to this request SERVER-5325, which you rejected, but I feel the rejecting is based on an assumption that MongoDB is used in environment with dedicated MongoDB ops people which is not the case in our situation.



 Comments   
Comment by Mark Benvenuto [ 06/Jun/14 ]

There are two implementations of the open source logrotate for Windows
http://sourceforge.net/projects/logrotatewin/
https://www.itefix.no/i2/logwot8

These utilties will allow you to control the rotation of the files.

Here is a sample logrotate script that will work for Windows. Note: This depends on the fix for SERVER-4905.

 "c:\mongod.log" {
       rotate 2
       size=100k
       sharedscripts
       postrotate
             mongo.exe --eval "db.runCommand('logRotate')" admin
       endscript
   }

Generated at Thu Feb 08 03:14:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.