-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.0.4
-
Component/s: Private API
-
None
-
Environment:JRuby 1.7.19, Fedora 20
Right now, the Ruby 2.x driver provides Mongo::Logger.logger, which is the single point of logging for the entire driver, even across multiple connections (and more to the point, multiple threads!)
This may potentially result in log interleaving when run across multiple threads (depending on the logger used), and it prevents individual connections from being able to opt out of logging, or to log at a different level from other connections.
A simple fix would be to allow `Mongo::Client#new` to accept a `logger` option which `Loggable` would pass to `Logger`, which would use it as an override log device. That way, individual connections could use their own loggers as desired, while maintaining the single global logger usage pattern.
As a side note, the on-by-default STDOUT log with regular ismaster pings when connected to a replica set makes using the client in an irb console rather frustrating.