I have a Replica Set with 3 MongoDB installed in Windows 2012 Server by using a configuration file through Windows Services.
Here is my mongod.cfg
storage: dbPath: E:\MongoDB\data journal: enabled: true systemLog: destination: file path: E:\MongoDB\log\mongod.log logRotate: rename logAppend: false timeStampFormat: iso8601-local
From my understanding, by setting logRotate to rename and logAppend to false this should happen automatically. For my surprise it does not!
MongoDB only rotates logs in response to the logRotate command, or when the mongod or mongos process receives a SIGUSR1 signal from the operating system.
After some digging, I found this ticket opened where it says that I should use a 3rd party tool to achieve it on Windows systems.
Is it the only way to rotate the logs on regular basis? And how would work in a Replica Set scenario?