setup root logging

Bug #979282 reported by clayg
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Alexej Ababilov

Bug Description

When using _setup_logging_from_flags (e.g. if you use devstack) - you can't see anything that might get logged from other modules (e.g. keystone.middleware.auth_token). I would imagine this same issue also prevents logging form other modules that nova uses (e.g. sqlalchemy , eventlet).

I'm not sure the pressures that moved things to the current implementation, but the "root" (heh) of the issue seems to be that nova.log._setup_logging_from_flags only adds handlers to the "nova" logger (look at the default name kwarg for the local definition of getLogger) and goes out of it's way to remove any handlers that were added to the root logger.

One fix would be to configure the handlers on the real root logger instead of nova_root, and let modules that are expecting logging to be setup by the app take advantage of a properly configured root logger instead of blasting their messages into NullHandler.

FWIW, if you use a log_config that does the right thing with a properly configured root logger it basically works like you'd expect.

Also it seems like at least in sqlalchemy's case it does some fancy stuff to add stream handler's all over the place if you set echo=True in engine_create. So the keystone middleware thing is the best example I have of this actually being a problem.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/7307

Changed in nova:
assignee: nobody → Alessio Ababilov (aababilov)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/7307
Committed: http://github.com/openstack/nova/commit/f6088545d2569423f4911bcddccc3a7eac36baf2
Submitter: Jenkins
Branch: master

commit f6088545d2569423f4911bcddccc3a7eac36baf2
Author: Alessio Ababilov <email address hidden>
Date: Thu May 10 12:52:03 2012 +0300

    Setup logging, particularly for keystone middleware

    Fixes bug 979282 and bug 988951

    Change-Id: I895d00ac9648e8b3cb3ad1bf141c9bfe02ef3680

Changed in nova:
status: In Progress → Fix Committed
Devin Carlen (devcamcar)
Changed in nova:
milestone: none → folsom-1
importance: Undecided → Low
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.