Skip to content

Conversation

alexbevi
Copy link

This PR will wrap the MongoClient creation with pymongo.driver_info.DriverInfo which makes it easier to filter mongod logs for connections that originate from djongo.

For example:

{"t":{"$date":"2024-06-03T16:10:26.686-04:00"},"s":"I","c":"NETWORK","id":51800,"ctx":"conn225","msg":"client metadata","attr":{"remote":"127.0.0.1:61857","client":"conn225","negotiatedCompressors":[],"doc":{"driver":{"name":"PyMongo|djongo","version":"3.11.4|1.3.7"},"os":{"type":"Darwin","name":"Darwin","architecture":"x86_64","version":"14.5"},"platform":"CPython 3.10.3.final.0"}}}

Added conditional import for DriverInfo from PyMongo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant