Changing MongoDB log file size
This section provides information on how to control MongoDB log file size.
About this task
This seems to be a limitation on MongoDB side , in that there are no parameters or settings to automatically control this.
You can do a couple of things to help keep it under control -
in etc/mongod.conf
add
logRotate: rename
and anytime the mongod service is restarted, it will create a new log file (and older ones can be deleted or archived)
You can also manually rotate log files in the mongo shell by giving the command
db.adminCommand( { logRotate : 1 } )
There are more details here -