[SERVER-18335] Automatically run logRotate after log file reaches specified size Created: 06/May/15 Updated: 08/Jan/19 Resolved: 08/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | sathish ravikumar | Assignee: | Mark Benvenuto |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Sprint: | Security 2019-01-28 | ||||||||
| Participants: | |||||||||
| Description |
|
if we want to change the log file , want to specify " { logRotate: 1 }" command each time to rotate log file . I want to set the log size limit. if exceed that limit it automatically create new log file. it will helpful that we don't need to check each time the log size and perform LogRotate Operation |
| Comments |
| Comment by Mark Benvenuto [ 08/Jan/19 ] |
|
The best way to handle log rotation with mongodb is use to use logrotate, a common configurable daemon available on Linux, macOS, and Windows. We have chosen not to try to duplicate the functionality offered by the logrotated daemon but we have instead done work to ensure that mongod will interop well with logrotated. For more information about rotating log files, see https://docs.mongodb.com/manual/tutorial/rotate-log-files/ For more information about logrotate, see: https://linux.die.net/man/8/logrotate https://wiki.archlinux.org/index.php/logrotate https://formulae.brew.sh/formula/logrotate https://chocolatey.org/packages/LogRotate https://github.com/logrotate/logrotate
|
| Comment by sathish ravikumar [ 06/May/15 ] |
|
Ramon, i did some workaround like checking size in batch file in windows and if exceed the limit rotating the log. |
| Comment by Ramon Fernandez Marina [ 06/May/15 ] |
|
sathism, I'm turning this into a feature request. As a workaround you may want to script this outside MongoDB using OS capabilities. For example, on Linux one can use cron or inotify to detect when the log file has reached the desired size, and then send SIGUSR1 to the mongod process. |