MongoDB logLevel is not default¶
Description¶
This advisor warns if the verbosity level of MongoDB logs is higher than the default value. It reports only a non-zero level that is set explicitly, in setParameter.logLevel or systemLog.verbosity; a mongod that does not set one is not reported.
The verbosity level is controlled by the logLevel parameter. Its value is an integer between 0 and 5, where 0 is the default log level (Informational) and 5 is the most verbose level.
Increasing the verbosity of log messages is useful for debugging purposes for a short period of time.
For more information, see db.setLogLevel() in the MongoDB documentation.
Resolution¶
The check reads the options mongod was started with, so changing the log level at runtime with db.setLogLevel() or setParameter doesn’t clear the finding.
To return to the default log level:
- In the configuration file, remove
setParameter.logLevelandsystemLog.verbosity, or set them to0. Also remove--setParameter logLeveland-voptions from themongodcommand line. - Restart the
mongodnodes for the change to take effect. For a cluster or replica set, use the rolling restart method.
Need more support from Percona?¶
Percona experts bring years of experience in tackling tough database performance issues and design challenges.