-
Type:
Improvement
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: 2.1.8
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Trying to change the driver log level appears to be impossible from the options object. It would be valuable to expose driver log level in mongo client options.
If mongo_client is created with options:
{ server: { loggerLevel: 'debug' }}
the options are swallowed at https://github.com/mongodb/node-mongodb-native/blob/2.1/lib/mongo_client.js#L260
A workaround is running the following line before initializing the driver, but it's a bit hackish:
require('mongodb-core/lib/connection/logger')('dummy',
);