We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am unable to log into a log file for any connection error, while it prints to stdout
--- Logging error --- Traceback (most recent call last): lib/python3.11/site-packages/log4mongo/handlers.py", line 295, in flush_to_mongo getattr(self.collection, write_many_method)(self.buffer)
Please let me know if anyone has already solved this.
The text was updated successfully, but these errors were encountered:
Please share more code, this is impossible to help you like this.
Sorry, something went wrong.
try: mongo = BufferedMongoHandler(host=uri, #username='', #password='', database_name='chatlogs', collection='logs', authentication_db='chatlogs', capped=True, buffer_size=1000, # buffer size. buffer_periodical_flush_timing=60.0, # periodical flush every 60 seconds buffer_early_flush_level=logging.CRITICAL)
log = logging.getLogger(name) log.addHandler(mongo) except Exception as e: logger.error (f"Could not connect to mongodb server: {traceback.format_exc()}", e.traceback ) raise CustomAPIException(e._message, e.code)
just to add my requirement is to log the connection error to a separate file instead standard output
No branches or pull requests
I am unable to log into a log file for any connection error, while it prints to stdout
--- Logging error ---
Traceback (most recent call last):
lib/python3.11/site-packages/log4mongo/handlers.py", line 295, in flush_to_mongo
getattr(self.collection, write_many_method)(self.buffer)
Please let me know if anyone has already solved this.
The text was updated successfully, but these errors were encountered: