in my project i am using the logging module and write the logs into a local .log file, in addition i want to pass the same log to another function to document locally the logs with circular queue algorithm. it is possible to configure the logger to do it? thanks .
the currnet logging config
logger=logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
formatter=logging.Formatter("<SOME FORMAT>")
file_handler=logging.FileHandler('logfile.log')
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
!! UPDATE : SOLVED - @imriqwe answer here https://stackoverflow.com/a/36408692 helped me to figure it.
I think this thread Python logging to multiple handlers, at different log levels? answers your question, it shows how to add multiple handlers, one file handler and one stream handler.