Disable NETWORK logs

I’d like to disable NETWORK logs but can’t find a way. As I can see in the docs, without using quiet I am already at the least verbose level with 0.

The verbosity level can range from 0 to 5 :

  • 0 is the MongoDB’s default log verbosity level, to include Informationalmessages.
  • 1 to 5 increases the verbosity level to include Debug messages.

Is there a way to remove NETWORK logs but keep useful logs such as slow queries and the likes ?

Welcome to the MongoDB Community @Vincent_Fiset !

I believe the option you are looking for is systemLog.quiet:

Type : boolean

Default : false

Run mongos or mongod in a quiet mode that attempts to limit the amount of output.

systemLog.quiet is not recommended for production systems as it may make tracking problems during particular connections much more difficult.

As noted in the documentation, enabling this option is not recommended for production systems as it limits visibility and diagnostics for issues based on the originating connection. This option reduces but does not completely suppress all log messages.

If you are using the default logging to a file destination, I recommend setting up Log Rotation to adjust log file size and retention options to be relevant for your requirements.

If you want to limit log output more aggressively than the quiet outcome, you can send logs to a syslog destination and use a logging service supporting filtering conditions. For example, on Linux you could use logging services like rsyslog, syslog-ng or Fluentd.

Regards,
Stennie

1 Like

Hi @Stennie ! I am under the impression that quiet would not be a good fit for me since:

Is there a way to remove NETWORK logs but keep useful logs such as slow queries and the likes ?

I feel like quiet will remove slow queries too. Is it ? I will test it.