Logger should be got by oslo.log getLogger instead of logging package
Bug #1788119 reported by
Yang Youseok
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.messaging |
Confirmed
|
Undecided
|
Ken Giusti |
Bug Description
I was trying to off log message in oslo.messaging package using `default_log_level` in config file, but debug message from oslo.messaging keep emitting.
After I dig the source, some modules like _drivers/
Åt the same time, module like _drivers/
I'm not sure it's intentional, but it seems to be bug since user expect the `default_log_level` affect the entire library package.
Changed in oslo.messaging: | |
status: | New → Confirmed |
assignee: | nobody → Ken Giusti (kgiusti) |
To post a comment you must log in.
Your observations are correct.
I talked a bit with Doug Hellman regarding what you're seeing. Way back we 'de-namespaced' the modules such that "oslo.messaging" became "oslo_messaging". This created problems for folks that had "oslo.messaging =<WHATEVER> " in their default_log_levels setting since the module name changed to 'oslo_messaging' and their log setting were being ignored.
To help fix that a workaround was added to oslo.log:
http:// git.openstack. org/cgit/ openstack/ oslo.log/ tree/oslo_ log/log. py#n446
So whenever oslo_log's getLogger is called it converts the name "oslo_messaging" to "oslo.messaging". However as you noticed some of the oslo.messaging files use the python library's getLogger, which doesn't do the translation and will not filter based on "oslo.messaging =<WHATEVER> "
So this is indeed a bug in oslo.messaging (as far as I'm concerned).
Workaround: include both "oslo.messaging =<WHATEVER> " and "oslo_messaging =<WHATEVER> " in your default_log_levels (note the '_' vs '.')