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