6

I just upgraded to mongodb 4.4.1 and the console is flooded with these messages, every other second:

D, [2020-11-03T03:28:32.885772 #24798] DEBUG -- : MONGODB | There was a change in the members of the 'Single' topology.
D, [2020-11-03T03:28:42.875739 #24798] DEBUG -- : MONGODB | Server description for localhost:27017 changed from 'standalone' to 'standalone' [awaited].
D, [2020-11-03T03:28:42.876668 #24798] DEBUG -- : MONGODB | There was a change in the members of the 'Single' topology.
D, [2020-11-03T03:28:42.888517 #24798] DEBUG -- : MONGODB | Server description for localhost:27017 changed from 'standalone' to 'standalone'.

Anyone know why this is happening, if it's bad, and how to stop?

user1130176
  • 1,772
  • 1
  • 23
  • 33
  • Set log level to info. – D. SM Nov 03 '20 at 19:14
  • thanks for the reply, but I need debug, I want to know if it's possible to disable this at the mongo level, it's like every second – user1130176 Nov 04 '20 at 10:57
  • you can see it here [enter link description here](https://stackoverflow.com/questions/30292100/how-can-i-disable-mongodb-log-messages-in-console) – lxc Nov 18 '20 at 06:07
  • Thanks, I don't want to disable ALL mongo log messages, just the every 1 second topology changed messages – user1130176 Nov 19 '20 at 15:41

1 Answers1

2

I’ve recently experienced similar behaviour with a Rails 6 application which uses Mongoid 7.1 to connect to a standalone (non-clustered) MongoDB 4.4 instance. The following makes a big assumption that you are also seeing this behaviour in the context of a Rails application which uses Mongoid.

The cause of this excessive logging seemed to be in the MongoDB Ruby Driver version which Mongoid relies upon. Specifically the default logging level in MongoDB Ruby Driver was set to Debug. When combined with the default logging behaviours of Rails and Mongoid this caused excessive logging of MongoDb topology events in non-production environments. See the public MongoDB Jira tickets below for more details.

https://jira.mongodb.org/browse/RUBY-2419

https://jira.mongodb.org/browse/RUBY-2356

Version 2.14 of MongoDB Ruby Driver introduced a fix to set the default logging level to be info. This driver version itself was later introduced to Mongoid.

Upgrading the Mongoid version used in the application seems to have resolved this.