It is important for troubleshooting and diagnostics purposes to activate MongoDB logging. Accordingly, there are a number of parameters that can be activated under the systemLog key, as summarized in this table:
Key | Notes |
path | Directory where log files will be created and stored. |
logAppend | When set to true, after a MongoDB server restart, new entries are appended to the existing log entries. If set to false (default), upon restart, the existing log file is backed up and a new one is created. |
verbosity | Determines how much information goes into the log. Verbosity levels range from 0 to 5, with 0 as the default. Level 0 includes informational messages. Setting verbosity to 1 through 5 increases the amount of information in the log message as well as debug information. |
component | This option opens up the possibility of creating more refinements in logging. As an example, to set logging verbosity to 1 for queries, but 2 for storage, add these settings... |