How to prune, and rename log file to a format

How to prune, and rename log file to a format.
Whenever we restart mongo it is creating a new file and old one is renamed.
we want to rename those logs in particular format. Is there any way we can do that ?

Hi @Sri_Sai_Ram_Akam

If you you’re interested in doing custom naming of your rotated logs then you will need another tool like logrotate to manage that or send it to syslog and configure that logging how you want to.

https://www.mongodb.com/docs/manual/tutorial/rotate-log-files/#log-rotation-with—logrotate-reopen

Example logrotate config: