Mongo logs every connection

My logs are flooded with connection messages:

{"t":{"$date":"2021-12-20T10:07:56.666+01:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn6237","msg":"client metadata","attr":{"remote":"10.0.0.3:57168","client":"conn6237","doc":{"driver":{"name":"nodej
{"t":{"$date":"2021-12-20T10:07:56.865+01:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn6235","msg":"Connection ended","attr":{"remote":"10.0.0.3:57044","connectionId":6235,"connectionCount":9}}
{"t":{"$date":"2021-12-20T10:07:56.866+01:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn6234","msg":"Connection ended","attr":{"remote":"10.0.0.3:57042","connectionId":6234,"connectionCount":8}}
{"t":{"$date":"2021-12-20T10:07:56.867+01:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn6236","msg":"Connection ended","attr":{"remote":"10.0.0.3:57046","connectionId":6236,"connectionCount":7}}
{"t":{"$date":"2021-12-20T10:07:56.868+01:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"10.0.0.3:57254","connectionId":6238,"connectionCount":8}}
{"t":{"$date":"2021-12-20T10:07:56.868+01:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"10.0.0.3:57256","connectionId":6239,"connectionCount":9}}
{"t":{"$date":"2021-12-20T10:07:56.868+01:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"10.0.0.3:57258","connectionId":6240,"connectionCount":10}}
{"t":{"$date":"2021-12-20T10:07:56.869+01:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn6238","msg":"client metadata","attr":{"remote":"10.0.0.3:57254","client":"conn6238","doc":{"driver":{"name":"nodej
{"t":{"$date":"2021-12-20T10:07:56.869+01:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn6239","msg":"client metadata","attr":{"remote":"10.0.0.3:57256","client":"conn6239","doc":{"driver":{"name":"nodej
{"t":{"$date":"2021-12-20T10:07:56.869+01:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn6240","msg":"client metadata","attr":{"remote":"10.0.0.3:57258","client":"conn6240","doc":{"driver":{"name":"nodej

The log configuration seems not to include debug messages:

rs_bud:SECONDARY> db.setLogLevel(0)
{
        "was" : {
                "verbosity" : 0,
                "network" : {
                        "verbosity" : -1,
                        "asio" : {
                                "verbosity" : -1
                        },
                        "bridge" : {
                                "verbosity" : -1
                        },
                        "connectionPool" : {
                                "verbosity" : -1
                        }
                },

How can I get rid off it? My server crashed because of no disk space left.

I have tried the quiet=true parameter that is not recommended for production deployments. It still produces hundreds of kilobytes per minute. How do you resolve it with high volume setups?

{“t”:{"$date":“2021-12-20T19:40:27.269+01:00”},“s”:“I”, “c”:“NETWORK”, “id”:51800, “ctx”:“conn267”,“msg”:“client metadata”,“attr”:{“remote”:“10.0.0.3:55014”,“client”:“conn267”,“doc”:{“driver”:{“name”:“nodejs”
,“version”:“3.7.3”},“os”:{“type”:“Linux”,“name”:“linux”,“architecture”:“x64”,“version”:“4.19.0-17-amd64”},“platform”:"'Node.js v12.21.0, LE (unified)"}}}
{“t”:{"$date":“2021-12-20T19:40:27.269+01:00”},“s”:“I”, “c”:“NETWORK”, “id”:51800, “ctx”:“conn268”,“msg”:“client metadata”,“attr”:{“remote”:“10.0.0.3:55016”,“client”:“conn268”,“doc”:{“driver”:{“name”:“nodejs”
,“version”:“3.7.3”},“os”:{“type”:“Linux”,“name”:“linux”,“architecture”:“x64”,“version”:“4.19.0-17-amd64”},“platform”:"'Node.js v12.21.0, LE (unified)"}}}
{“t”:{"$date":“2021-12-20T19:40:27.270+01:00”},“s”:“I”, “c”:“NETWORK”, “id”:51800, “ctx”:“conn269”,“msg”:“client metadata”,“attr”:{“remote”:“10.0.0.3:55018”,“client”:“conn269”,“doc”:{“driver”:{“name”:“nodejs”
,“version”:“3.7.3”},“os”:{“type”:“Linux”,“name”:“linux”,“architecture”:“x64”,“version”:“4.19.0-17-amd64”},“platform”:"'Node.js v12.21.0, LE (unified)"}}}

1 Like

Did you bounce/restart your mongod after making changes to config file?

If your log file is growing huge you have use logrotate and delete old files
It is not possible to supress the logging completely and not advisable as some tracking is needed for troubleshooting
You will see informational messages even if you set LogLevel(0)
What does db.getLogComponents() show.Try to set logging for components/features
Check these links.

1 Like