Reset Search
 

 

Article

Clearing Mongo Logs

« Go Back

Information

 
TitleClearing Mongo Logs
ProblemSteps to clear Mongo logs when they are full.
Solution

Logs for Mongo DB are located on your Mongo servers in /var/log/mongodb. The specific log name is mongod.log


Sometimes the logs will be full.

You can determine this by typing from the bash $ prompt: df -h


If you see a full folder, you can empty it. Below we use the example that the /var folder is 100% full

 

You can empty this by using the following command (NOTE: Make sure the "*" is at the end, as to not delete the directory):
 

$ sudo rm -f /var/log/mongodb/*


Followed by restarting the mongo service using the below command:
 

$ sudo service mongod restart {note, "mongod" not "mongodb" }

 

If it throws an error on the attempted restart, wait several seconds and try once more. 

 

URL NameGathering-Mongo-Logs

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255