Python child logger should report back to root logger instead of applying its own logging configs
Question: As mentioned here <http://stackoverflow.com/a/4150322/1526342>. When logging
to child logger, it will pass on the message to its parent, and its parent
will pass the message to the root logger. Now considering the following
example

    
    
    import logging
    import logging.handlers
    child_logger = logging.getLogger(__name__)
    f = logging.Formatter(
            fmt='%(asctime)s; %(name)s; % (filename)s:%(lineno)d:%(message)s',
            datefmt="%Y-%m-%d %H:%M:%S")
    handler = logging.handlers.RotatingFileHandler('/tmp/info.log',
                                                   encoding='utf8',
                                                   maxBytes=500000000,
                                                   backupCount=5)
    handler.setFormatter(f)
    child_logger.setLevel(logging.INFO)
    child_logger.addHandler(handler)
    child_logger.info('1 + 1 is %d', 1+1)
    

`child_logger` should have reported back to the root logger instead of
printing the output to the child_logger's log file.

I'm confused.


Answer: As shown in [this logging flow
chart](https://docs.python.org/3/howto/logging.html#logging-flow), loggers
pass log records both to own handlers _and_ to parent logger objects. Try
adding a handler to the parent logger, you'll see the log record is being
processed there as well.

