That's really a feature needs to be done,the log is very big and we can not make it quiet because we may analyze the log to see if something goes wrong.Now we use "killall -SIGUSR1 mongod" to rotate the log,is that right?Is there some potential harm to the mongod?
Hi,
As noted on the Logging page, SIGUSR1 on Linux can be used for log rotation:
This won't cause any "harm" to the mongod, however as also noted on the logging page there is a potential bug to be aware of:
The current recommendation to avoid SERVER-4739 is to instead use the logRotate command from the mongo shell.
It's also worth noting that the --syslog option added in MongoDB 2.2 will let you use standard syslog features like filtering & log rotation. With syslog filtering you can generally use regular expressions to separate messages of interest into different log files (or suppress those that are just noise).
For example, Rsyslog is the current default for Ubuntu Server 10.04+:
Cheers,
Stephen