-1

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.

Community
  • 1
  • 1
Vimal
  • 189
  • 1
  • 3
  • 13
  • You'll just need to implement your own logging Handler and then add it to some loggers in the logging configuration. – jb. Oct 01 '14 at 12:40
  • I have implemented a logging handler. But could not figure out to push it into mongodb – Vimal Oct 01 '14 at 12:40
  • You don't have to "push handler to mongodb" your handler needs to establis connection to this database and then post logs to it. – jb. Oct 01 '14 at 12:41

1 Answers1

-1
  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)