user1853088
user1853088

Reputation: 69

Mongo db log disabling

I dont want mongodb to log anything in mongod.log . Please let me know how to suppress the same as it is growing in size and occupy lot of space. I have tried with mongo.conf file but it looks there is no option to disable logs

Thanks

Upvotes: 5

Views: 22375

Answers (3)

John Peterson
John Peterson

Reputation: 846

Not sure if this works or not send logs to /dev/null ?

systemLog:
  destination: file
  logAppend: true
  logRotate: reopen
  quiet: true
  #path: /var/log/mongodb/mongod.log
  path: /dev/null

or can also add to crontab ( empty file every 30 min )

*/30 * * * * cat /dev/null > /var/log/mongodb/mongod.log

Upvotes: 4

Abhinav Singh
Abhinav Singh

Reputation: 1

You could disable profilling in mongoDB or set a Profiling level .

More here http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/

Upvotes: 0

Abhishek Kumar
Abhishek Kumar

Reputation: 3356

1) db.adminCommand({setParameter:1, logLevel:0 }) // from mongo shell, this can be set using config file too

2) disable slow query profiling in config file

3) in config file, set, quiet = true

Upvotes: -3

Related Questions