Search code examples
pythonloggingtornado-motor

Python Custom Logger


I have actually got the steps to follow to create the custom logger from the below link:

Python: custom logging across all modules

But how do i actually store the logs in Mongodb and pull it and post it on my front end.


Solution

    1. Create a file-like Class,that is implement its write method in which you can write logics for inserting data to mongo
    2. Create a StreamHandler using your own file-like Object as a stream.
    3. logger.addHandler(yourHandler)