Rotate the log file
MongoDBMaintenanceCommand
db.adminCommand({ logRotate: 1 })What it does
Closes the current log file and opens a new one (log rotation).
When to use it
When the log file has grown or before archiving.
Caution
If used together with OS log rotation, check the configuration to avoid conflicts.