Need to minimize mongodb logs

Hello everyone,

I am working on a project in which I have used mongoDb as database,
I have setup 3 replicas on mongodb,
My question is:-

I am facing a lot of mongoDb logs in the log file of mongodb, and I want to minimize the logs, to which verbosity level I should have to set the logs?

My current setting for logs in config file is:-

  destination: file
  logAppend: true
  path: /data/log/mongodb/mongod.log
         verbosity: 1
         verbosity: 1
      # COMMENT some component verbosity settings omitted for brevity
         verbosity: 1
            verbosity: 1
            verbosity: 1
            verbosity: 1
            verbosity: 1
         verbosity: 1
            verbosity: 1
            verbosity: 1
         verbosity: 1```

Please suggest me the log verbosity level, by which I will have minimum logs.
And one more question, Is more logs make any impact on mongoDb performance.
e.g. If my mongoDb logs file will goes upto 30GB of size in a day, will it impact on mongodb performance?

A verbosity level can have values from 0 to 5. The level 0 is the default value for verbosity, which logs basic informational messages about the on-going component activities. The log levels 1 through 5 further includes additional debug messages as well in the log file. The higher the number the more verbose your debug messages are. The verbosity level of negative one (-1) means that the object inherits the verbosity level from its parent component.

To retrieve the current log components from the database with their respective verbosity, run the below command:


To change the verbosity level of individual component, for instance the “INDEX” component, use the below command:

db.setLogLevel(0, “index”)

Logs are append only so very fast. But it’s difficult to say when you have hundred GB. Better try it yourself.