[openstack-dev] [oslo] Austin summit session recap(s)

Alexis Lee lxsli at hpe.com
Thu May 12 09:22:29 UTC 2016

Doug Hellmann said on Wed, May 11, 2016 at 08:45:16AM -0400:
> Yes, handler, sorry.
> I thought they were only unconfigured if the flag was set to do that,
> and that your patch had the disable_existing_loggers flag set to not do
> it? Maybe I misunderstood the full meaning of the flag, though, and it
> only affects loggers and not handlers?

It only affects loggers. Here's the relevant part of logging:

    183 def _install_loggers(cp, handlers, disable_existing_loggers):
    259     #Disable any old loggers. There's no point deleting
    260     #them as other threads may continue to hold references
    261     #and by disabling them, you stop them doing any logging.
    262     #However, don't disable children of named loggers, as that's
    263     #probably not what was intended by the user.
    264     for log in existing:
    265         logger = root.manager.loggerDict[log]
    266         if log in child_loggers:
    267             logger.level = logging.NOTSET
    268             logger.handlers = []
    269             logger.propagate = 1
    270         else:
    271             logger.disabled = disable_existing_loggers

The issue I mentioned is that non-child loggers aren't reset if
disable_existing_loggers is False. It's easy enough to work around that
though, new patchset is up.

Alexis (lxsli)
Nova developer, Hewlett-Packard Limited.
Registered Office: Cain Road, Bracknell, Berkshire RG12 1HN.
Registered Number: 00690597 England
VAT number: GB 314 1496 79

More information about the OpenStack-dev mailing list