Incorrect loggers level configuration in oslo projects

Bug #1567902 reported by Kirill Bespalov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.log
Invalid
Undecided
Kirill Bespalov

Bug Description

The getLogger(__name__) method of log.py module in oslo_log
maintain old oslo loggers names by replacing a non-namespaced
prefix 'oslo_x' of module name with 'oslo.x'. It still allow
configuring a logging level of any oslo module with old style
namespaced name.

For example the default log level of oslo messaging:
 'oslo.messaging=INFO'

However, many oslo libraries use direct import of python
loggging module, that knows nothing about oslo prefix and
create loggers with original non-namespaced module name (oslo_x).

Examples of suchlike importing you can find here:

 1)direct py logging:
   oslo_messaging._drivers.amqpdriver
 2)oslo.log:
  oslo_messaging._drivers.impl_rabbit

It means that after initialization will be created two types
of loggers: oslo_messaging.x and oslo.messaging.y. For
oslo.messaging.y loggers default log level can be applied,
for oslo_messaging.x not and their log lever will be 0, that
making them dependent on the root log level of logger.

Possible solution:
 1) fix the setup log method in oslo_log to allow detect
  both log level configuration naming styles: oslo_x and oslo.x
 2) remove useless loggers name renaming in the getLogger method
 3) remove all oslo_log usages in oslo.messaging. It is library,
  not standalone project or an application and should not depends on the oslo_log.

Changed in oslo.log:
assignee: nobody → Kirill Bespalov (k-besplv)
description: updated
Revision history for this message
Kirill Bespalov (k-besplv) wrote :

Proof of the bug. After initialization we have two different sets of loggers.
One with default log level, other with 0 level.

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

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

Changed in oslo.log:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.log (master)

Change abandoned by Kirill Bespalov (<email address hidden>) on branch: master
Review: https://review.openstack.org/303609

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Kirill Bespalov (<email address hidden>) on branch: master
Review: https://review.openstack.org/303581

Changed in oslo.log:
status: In Progress → New
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

Is this still an issue?

Changed in oslo.log:
status: New → Incomplete
Changed in oslo.log:
status: Incomplete → Invalid
status: Invalid → Won't Fix
status: Won't Fix → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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