RFE: libguestfs logging should be connected up to openstack logging
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Wishlist
|
Sahid Orentino |
Bug Description
https:/
We were trying to chase up a bug in libguestfs integration with
OpenStack. It was made much harder because the only way to diagnose
the bug was to manually run the nova service after manually setting
environment variables:
http://
It would be much nicer if:
(1) There was a Nova setting to enable debugging, like:
libguestf
or something along those lines.
(2) Nova used the events API to collect libguestfs debug messages
and push them into Openstack's own logging system. See code
example below.
---------
Here is how you enable logging programmatically and capture
the log messages.
(a) As soon as possible after creating the guestfs handle, call
either (or better, both) of these functions:
g.set_trace (1) # just traces libguestfs API calls
g.set_verbose (1) # verbose debugging
(b) Register an event handler like this:
events = guestfs.
| guestfs.
g.set_event_
(c) The log_callback function should look something like this:
def log_callback (ev,eh,buf,array):
if ev == guestfs.
buf = buf.rstrip()
# What just happened?
LOG.debug ("event=%s eh=%d buf='%s' array=%s" %
There is a fully working example here:
https:/
Changed in nova: | |
importance: | Undecided → Wishlist |
tags: | added: compute |
Changed in nova: | |
status: | New → Triaged |
Changed in nova: | |
assignee: | nobody → sahid (sahid-ferdjaoui) |
Changed in nova: | |
milestone: | none → kilo-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | kilo-1 → 2015.1.0 |
Fix proposed to branch: master /review. openstack. org/124700
Review: https:/