Python loggers output all messages to stdout in addition to log file All logging output is handled by the handlers; just add a logging.StreamHandler() to the root logger.
Here’s an example configuring a stream handler (using stdout instead of the default stderr) and adding it to the root logger:
root = logging.getLogger()
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.