-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Logging
-
None
Currently mongod doesn't work completely satisfactorily with Linux logrotate.The standard method of allowing logrotate to rename the file doesn't work because mongod continues writing to the open fd of the renamed file instead of to the new file. You can use the "copytruncate" option which causes logrotate to copy the current log file to the rotated file and then truncate the current log file to delete the old entries, but this a) requires that the file be copied instead of just renaming it and b) loses any log entries made between the copy and the truncate.
This could be fixed if there were some way to force mongod to close the current log file and open it again. Ideally this would be a signal (to simplify using it in a logrotate script), possibly SIGUSR1 with alternate semantics specified by a configuration option.
- duplicates
-
SERVER-4905 logRotate should conform to standard log rotation mechanisms
- Closed