Hi all,
I want to configure logrotate on my Linux server to have a rotation and suppression of the old log file. My mongod.conf file is set as follow:
where to write logging data.
systemLog:
destination: file
logAppend: false
path: /var/log/mongodb/mongod.log
And the logrotate for MongoDB is :
cat /etc/logrotate.d/mongodb
/var/log/mongodb/mongod.log {
daily
rotate 7
compress
missingok
notifempty
copytruncate
delaycompress
postrotate
/bin/kill -SIGUSR1 $(pidof mongod) # Notify MongoDB to reopen logs
endscript
}
I would like know if it is correct ? I’m not sure that’s work correctly.
Thanks for your help
Olivier