gnulnx / django-mongolog

A Simple Mongo Based Logger for Django
http://gnulnx.github.io/django-mongolog/
GNU General Public License v3.0
15 stars 4 forks source link

Connecting to MongoDB Atlas #82

Open muhashil opened 4 years ago

muhashil commented 4 years ago

Can we use MongoDB Atlas for this Django mongolog? I've changed my connection URL to the Atlas URL but I got this error when I tried to run my app.

ValueError: Unable to configure handler 'mongolog': No replica set members match selector "Primary()"

Thank you..

gnulnx commented 4 years ago

@muhashil Sorry I am just seeing this. I have not tried ot use this with Mongo Atlas. I'd definitely be down with a PR that added support for it.

muhashil commented 4 years ago

I think the problem is in handlers.connect_pymongo3 function. The parameter serverSelectionTimeoutMS of 5ms is too small to connect to MongoDB Atlas. I've solved my problem by changing the serverSelectionTimeoutMS to 500ms.