Question

The log is 15 Gigabytes. I guess I have to back it up and delete. I have enough hard disc space, but did not realize log was so large. And overnight cron jobs suddenly started to die in the middle.

Was it helpful?

Solution

If you are talking about the MongoDB log file becoming too large you should take a look at the log rotation options here:

http://www.mongodb.org/display/DOCS/Logging#Logging-Rotatingthelogfiles

Short version - you can rotate the logs via an admin command within MongoDB or you can send a SIGUSR1 - combine with your favorite log management method and you should be good.

Something else to consider though is why the log is so large - unless it has been running for a long, long time, 15GB is a lot of logging. You may want to make sure that you are not starting up with logging set too high (-vv etc.). You can also check the log level with the setParameter command. For example, to set to 0 (the default), without restarting, just issue it like this:

db.adminCommand({setParameter:1, logLevel:0})
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top