MongoDB annoying logs

When I use docker and include MongoDB image within it, I get many annoying logs, and in versions prior to 6.0.8 of Mongoose I was able to hide them via these properties:

{
    useNewUrlParser: true,
    useUnifiedTopology: true,
    useFindAndModify: false,
}

but these are deprecated with the mentioned version of Mongoose in Express framework, how can I remove these logs:

2023-10-15 18:00:47 {"t":{"$date":"2023-10-15T15:00:47.896+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn2","msg":"Connection ended","attr":{"remote":"172.18.0.5:43556","connectionId":2,"connectionCount":2}}
2023-10-15 18:00:47 {"t":{"$date":"2023-10-15T15:00:47.896+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn3","msg":"Connection ended","attr":{"remote":"172.18.0.5:36812","connectionId":3,"connectionCount":1}}
2023-10-15 18:00:47 {"t":{"$date":"2023-10-15T15:00:47.897+00:00"},"s":"I",  "c":"-",        "id":20883,   "ctx":"conn1","msg":"Interrupted operation as its client disconnected","attr":{"opId":66779}}
2023-10-15 18:00:47 {"t":{"$date":"2023-10-15T15:00:47.932+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn1","msg":"Connection ended","attr":{"remote":"172.18.0.5:43552","connectionId":1,"connectionCount":0}}
2023-10-15 18:00:53 {"t":{"$date":"2023-10-15T15:00:53.722+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.5:55774","connectionId":4,"connectionCount":1}}
2023-10-15 18:00:53 {"t":{"$date":"2023-10-15T15:00:53.762+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn4","msg":"client metadata","attr":{"remote":"172.18.0.5:55774","client":"conn4","doc":{"driver":{"name":"nodejs|Mongoose","version":"5.9.0|7.6.1"},"platform":"Bun v1.0.6, LE","os":{"name":"linux","architecture":"x64","version":"5.15.90.1-microsoft-standard-WSL2","type":"Linux"}}}}
2023-10-15 18:00:53 {"t":{"$date":"2023-10-15T15:00:53.772+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.5:55788","connectionId":5,"connectionCount":2}}
2023-10-15 18:00:53 {"t":{"$date":"2023-10-15T15:00:53.785+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn5","msg":"client metadata","attr":{"remote":"172.18.0.5:55788","client":"conn5","doc":{"driver":{"name":"nodejs|Mongoose","version":"5.9.0|7.6.1"},"platform":"Bun v1.0.6, LE","os":{"name":"linux","architecture":"x64","version":"5.15.90.1-microsoft-standard-WSL2","type":"Linux"}}}}
2023-10-15 18:00:54 {"t":{"$date":"2023-10-15T15:00:54.004+00:00"},"s":"I",  "c":"ACCESS",   "id":20250,   "ctx":"conn5","msg":"Authentication succeeded","attr":{"mechanism":"SCRAM-SHA-256","speculative":true,"principalName":"Bader","authenticationDatabase":"admin","remote":"172.18.0.5:55788","extraInfo":{}}}
2023-10-15 18:01:04 {"t":{"$date":"2023-10-15T15:01:04.283+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.18.0.5:48202","connectionId":6,"connectionCount":3}}
2023-10-15 18:01:04 {"t":{"$date":"2023-10-15T15:01:04.287+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn6","msg":"client metadata","attr":{"remote":"172.18.0.5:48202","client":"conn6","doc":{"driver":{"name":"nodejs|Mongoose","version":"5.9.0|7.6.1"},"platform":"Bun v1.0.6, LE","os":{"name":"linux","architecture":"x64","version":"5.15.90.1-microsoft-standard-WSL2","type":"Linux"}}}}
2023-10-15 18:01:34 {"t":{"$date":"2023-10-15T15:01:34.838+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1697382094:838064][1:0x7f53e9bf0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 182, snapshot max: 182 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1183"}}
2023-10-15 18:02:35 {"t":{"$date":"2023-10-15T15:02:35.357+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1697382155:357968][1:0x7f53e9bf0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 184, snapshot max: 184 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1183"}}
2023-10-15 18:03:35 {"t":{"$date":"2023-10-15T15:03:35.377+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1697382215:377101][1:0x7f53e9bf0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 186, snapshot max: 186 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1183"}}
2023-10-15 18:04:35 {"t":{"$date":"2023-10-15T15:04:35.395+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1697382275:395863][1:0x7f53e9bf0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 188, snapshot max: 188 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1183"}}
2023-10-15 18:05:35 {"t":{"$date":"2023-10-15T15:05:35.414+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1697382335:414022][1:0x7f53e9bf0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 190, snapshot max: 190 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1183"}}
2023-10-15 18:06:35 {"t":{"$date":"2023-10-15T15:06:35.438+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1697382395:438164][1:0x7f53e9bf0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 192, snapshot max: 192 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1183"}}
2023-10-15 18:07:35 {"t":{"$date":"2023-10-15T15:07:35.458+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1697382455:458627][1:0x7f53e9bf0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 194, snapshot max: 194 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1183"}}
2023-10-15 18:08:35 {"t":{"$date":"2023-10-15T15:08:35.479+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1697382515:479472][1:0x7f53e9bf0700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 196, snapshot max: 196 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 1183"}}

Hello there,

Either, set the log level, or, depending on how you instantiate a new db process, you can change the verbosity of the mongod command.

Hope this helps

1 Like

setting the log level solved the issue, thanks to you Hamilton, @Sky020