Details
-
Improvement
-
Resolution: Won't Do
-
Major - P3
-
None
-
None
-
None
-
1
Description
Due to some known problems using logrotate (SERVER-14053) and thanks to the changes performed on SERVER-4905. The log rotation approach based on logrotate standard tool should be included in the documentation.
The following is a logrotate configuration extracted from one of the comments on SERVER-14053.
/var/log/mongodb/mongod.log { |
daily
|
size 1G
|
rotate 10
|
missingok
|
compress
|
compresscmd /usr/bin/bzip2 |
uncompresscmd /usr/bin/bunzip2 |
compressoptions -9
|
compressext .bz2
|
delaycompress
|
notifempty
|
create 640 mongod mongod
|
sharedscripts
|
postrotate
|
/bin/kill -SIGUSR1 `cat /var/run/mongodb/mongod.pid 2>/dev/null` >/dev/null 2>&1 |
find /var/log/mongodb -type f -size 0 -regextype posix-awk -regex "^\/var\/log\/mongodb\/mongod\.log\.[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}$" -execdir rm {} \; >/dev/null 2>&1 |
endscript
|
}
|