[Python] Does child logger inherit 'format' of root logger?

Discussão em 'Python' iniciado por Stack, Março 25, 2025.

  1. Stack

    Stack Membro Participativo

    I understand that python logging allows to creates parent child relationship using: logger = logging.getLogger(parent.child). Here the chain is: Root logger <- parent <- child

    I have configured the root logger format using: logging.basicConfig(format='%(levelname)s:%(message)s')

    However, when I use the flask's app.logger.info('some message'), which I believe is the child of the root logger; it is not inheriting the format of the python root logger. Does child logger inherit format of root logger?

    Continue reading...

Compartilhe esta Página