Open eiscan opened 4 years ago
Can you please post a complete trace?
Can you please post a complete trace?
Sorry, I did not fully understand what you mean?
Copy paste the complete crash code.
Copy paste the complete crash code.
The code block I'm trying to link to.
import logging
from log4mongo.handlers import MongoHandler
def Connection()
logging.basicConfig(level=logging.CRITICAL)
logger = logging.getLogger(__name__)
mongo = MongoHandler(host='46.222.73.115',
username='testeko',
password='aSd1234',
database_name='TestDB')
logger.addHandler(mongo)
if __name__ == "__main__":
Connection()
However, I can connect to the same database with this connection string.
from pymongo import MongoClient
client = MongoClient("mongodb+srv://testeko:aSd1234@46.222.73.115:27017/TestDB?retryWrites=true&w=majority")
Please, remove your credentials. I still don't see the crash trace.
Please, remove your credentials. I still don't see the crash trace.
Hi, When I say credentials, I do not fully understand what you mean. Where will I delete my credentials?
import logging
from log4mongo.handlers import MongoHandler
def Connection()
logging.basicConfig(level=logging.CRITICAL)
logger = logging.getLogger(__name__)
mongo = MongoHandler( )
logger.addHandler(mongo)
if __name__ == "__main__":
Connection()
your posted your user name and password.
When your run the following program in python:
1/0
You will get the traceback:
python e.py
Traceback (most recent call last):
File "e.py", line 1, in <module>
1/0
ZeroDivisionError: integer division or modulo by zero
I need to see the error you are getting.
I would like to share the connection information I wrote with you. If you can send a mail to matt_perry@outlook.com.tr, I would like to share the files with you. Thank you also for your help to solve the problem.
Hi @oz123 ,
Connection string that Mongo Atlas gave me:
mongodb+srv://matt_perry:
I want to show you exactly the sample code. I got the connection string from mongo atlas.
import logging
from log4mongo.handlers import MongoHandler
#mongodb+srv://matt_perry:<password>@cluster0-jf8ht.mongodb.net/test?retryWrites=true&w=majority
def Connection():
logging.basicConfig(level=logging.CRITICAL)
logger = logging.getLogger(__name__)
mongo = MongoHandler(host='cluster0-jf8ht.mongodb.net',
username='matt_perry',
password='asdf1234',
database_name='TestDB')
logger.addHandler(mongo)
if __name__ == "__main__":
Connection()
Hi, You have not returned to the last message.
Thanks.
I sent you a private message. via your email.
Hi, I have a database in Mongo Atlas but cannot connect.
My connection code:
The original connection string "mongodb+srv://testeko:aSd1234@.....mongodb.net/TestDB?retryWrites=true&w=majority"
It gives this error when trying to connect. pymongo.errors.ServerSelectionTimeoutError: connection closed
Python : 3.7.4, log4mongo : 1.7.0, pymongo : 3.9.0
What should I do?
Thank you.