How to set the log level in the MongoDB configuration file?

You can set the log level in the MongoDB configuration file. The default logging level is ‘info’, but can be changed to any of the following levels: debug, info, warn, error, and fatal.

To change the log level, use the following syntax in the MongoDB configuration file (mongod.conf):

logLevel:

e.g. To set the log level to “error”, the configuration would look like this:

logLevel: error

Leave a Comment

Your email address will not be published. Required fields are marked *