Closed john012343210 closed 3 years ago
To avoid a lot of writes to mongodb you can use BufferedMongoHandler
which is made exactly for this purpose.
Being buffered it means it writes in bulk after a certain delay.:
This subclass aims to provide buffering mechanism to avoid hammering the database server and write-locking the database too often (even if mongo is performant in that matter).
From the documentation of the subclass. I hope this helps you.
Hi. I have some experience in MongoDB
Since Atlas provides some free cluster, I am looking for some correct way that logs to the database. However, does MongoDB suitable for storing logs from python? Also due to the write lock contention, how could I solve this issue when using your library?
Thanks! I love python. I love logging. I love mongodb.