DBAtlas · Database operations atlas

Rotate the log file

MongoDBMaintenance

Command

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.

Open in DBAtlas →

Related