[Python] Making Python loggers output all messages to stdout in addition to log file

Discussão em 'Python' iniciado por Stack, Julho 7, 2025.

  1. Stack

    Stack Membro Participativo

    Is there a way to make Python logging using the logging module automatically output things to stdout in addition to the log file where they are supposed to go? For example, I'd like all calls to logger.warning, logger.critical, logger.error to go to their intended places but in addition always be copied to stdout. This is to avoid duplicating messages like:

    mylogger.critical("something failed")
    print("something failed")

    Continue reading...

Compartilhe esta Página