Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we limit the size of the log files generated by mongodb ? (i.e /var/log/mongodb/*.log)

Can we use the configuration file for limiting the log file size ? (i.e /etc/mongod.conf)

like image 932
Dheeraj vats Avatar asked Jan 20 '17 06:01

Dheeraj vats


1 Answers

in Doc - Logging Parameters - maxLogSizeKB

https://docs.mongodb.com/manual/reference/parameters/

Example, config file mongodb.conf

setParameter:
   maxLogSizeKB: 20

But number of files can be any?

Or you can use parametr - quiet

setParameter:
   quiet: 1
like image 111
gotostereo Avatar answered Nov 15 '22 10:11

gotostereo