OpenStack Compute (Nova)

All debug log entries end in same source code and line

Reported by Jay Pipes on 2012-01-24
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Alex Meade

Bug Description

The introspection of the originating source code line for DEBUG log messages is useless, as it always indicates the source code line for the log.debug():

2012-01-23 22:37:21,324 DEBUG nova.utils [-] Attempting to grab semaphore "iptables" for method "apply"... from (pid=9163) debug /opt/stack/nova/nova/log.py:175
2012-01-23 22:37:21,324 DEBUG nova.utils [-] Got semaphore "iptables" for method "apply"... from (pid=9163) debug /opt/stack/nova/nova/log.py:175
2012-01-23 22:37:21,324 DEBUG nova.utils [-] Attempting to grab file lock "iptables" for method "apply"... from (pid=9163) debug /opt/stack/nova/nova/log.py:175
2012-01-23 22:37:21,325 DEBUG nova.utils [-] Got file lock "iptables" for method "apply"... from (pid=9163) debug /opt/stack/nova/nova/log.py:175
2012-01-23 22:37:21,325 DEBUG nova.utils [-] Running cmd (subprocess): sudo iptables-save -t filter from (pid=9163) debug /opt/stack/nova/nova/log.py:175

Every single DEBUG line ends this way...

Brian Waldon (bcwaldon) on 2012-01-27
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
Alex Meade (alex-meade) wrote :

The issue is that logging gets the current stack frame and then goes back to the previous one to get the information about what called the log method. Since this is the case, we cannot add any more calls to the stack between the calling of log.debug and it's calling of log._log.

At the moment we have one in the middle, I'll have a MP in a min to fix this.

Changed in nova:
assignee: nobody → Alex Meade (alex-meade)
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/3634
Committed: http://github.com/openstack/nova/commit/84cf57fde657eb4146442047a565fd7087bce345
Submitter: Jenkins
Branch: master

commit 84cf57fde657eb4146442047a565fd7087bce345
Author: Alex Meade <email address hidden>
Date: Wed Feb 1 20:35:50 2012 +0000

    Fix logging to log correct filename and line numbers

    Fixes bug 920809.

    Change-Id: I192159efbb8d678d1e1071b18233d19ebcd7198b

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-02-29
Changed in nova:
milestone: none → essex-4
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-4 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers