Closed nabeenb closed 11 months ago
I have a situation to log to file and same time to write to mongodb log with different logging.basicConfig level of Info and Error. Any idea how can achieve this? If I set basic config to Error I can't log as Info to file.
You need to define two handlers.
One for the mongo and one for the find. Basic config is... Well... Basic...
logger = logging.getLogger().addHandler(mongohandler) logger.addHandler(filehandler)
I have a situation to log to file and same time to write to mongodb log with different logging.basicConfig level of Info and Error. Any idea how can achieve this? If I set basic config to Error I can't log as Info to file.