How to suppress mongod's heart rate output in irb

I am trying to deal with a thinly documented new Ruby rewritable driver for Mongodb 2.0.

I want to work interactively, but the "heartbeat" monitor, which works every 10 seconds, seems to ignore my attempts to set it up for a longer period:

irb(main):004:0> client = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'dbname', :heartbeat_frequency => 600)

But exactly ten seconds later the flood begins:

D, [2015-04-26T05:22:20.553320 #4123] DEBUG -- : MONGODB | COMMAND | namespace=admin.$cmd selector={:ismaster=>1} flags=[] limit=-1 skip=0 project=nil | runtime: 2.9023ms
=> #<Mongo::Client:0x10048740 cluster=127.0.0.1:27017>
irb(main):005:0> D, [2015-04-26T05:22:30.555284 #4123] DEBUG -- : MONGODB | COMMAND | namespace=admin.$cmd selector={:ismaster=>1} flags=[] limit=-1 skip=0 project=nil | runtime: 0.8411ms

Is there any way to stop this; it destroys the screen and makes interaction with the backend impossible.

+4
source share
2 answers

The registrar level must be changed to another level. The default level is DEBUG (0)
For example:

Mongo::Logger.logger.level = Logger::WARN

:
http://ruby-doc.org/stdlib-2.2.0/libdoc/logger/rdoc/Logger.html#class-Logger-label-Description

+4

:heartbeat_frequency :heartbeat

0

Source: https://habr.com/ru/post/1584716/


All Articles