Can I empty the log file without spoiling the installation? I do not want to erase it. I have the installation in linux, if so, how could I do it?
There are a couple of options. Probably the best way is to rotate the log file, for example via the mongo shell:
use admin
db.runCommand( { logRotate : 1 } )
You can also send a signal to the mongod process, this won't kill the process, it will just signal it to perform the rotation. Run from the linux shell:
kill -SIGUSR1 <mongod pid>
Another option to "clear" the existing log is to run (specify full path or run from the same directory as the log file):
cp /dev/null mongod.log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With