From 605c22b1804f0a34d400eb57e1954c3fc3a20c88 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Wed, 1 Feb 2012 11:41:22 +1100 Subject: Optionally pass a instance uuid to log methods. This change is intended to make log messages including instance uuids consistent. This eases operational support, as when a customer asks for the history of there instance it is a simple grep operation, instead of the current situation. I have included a sample use, but will work through adding this to relevant log messages over time. Change-Id: I1f61c04f32dbb960471950ac7231313d9d9ced12 --- nova/virt/libvirt/connection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nova/virt') diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index edd2c4741..7a4704693 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -690,7 +690,8 @@ class LibvirtConnection(driver.ComputeDriver): block_device_info=block_device_info) domain = self._create_new_domain(xml) - LOG.debug(_("instance %s: is running"), instance['name']) + LOG.debug(_("instance %s: is running"), instance['name'], + instance=instance) self.firewall_driver.apply_instance_filter(instance, network_info) def _wait_for_boot(): @@ -701,12 +702,12 @@ class LibvirtConnection(driver.ComputeDriver): state = self.get_info(instance_name)['state'] except exception.NotFound: msg = _("During reboot, %s disappeared.") % instance_name - LOG.error(msg) + LOG.error(msg, instance=instance) raise utils.LoopingCallDone if state == power_state.RUNNING: msg = _("Instance %s spawned successfully.") % instance_name - LOG.info(msg) + LOG.info(msg, instance=instance) raise utils.LoopingCallDone timer = utils.LoopingCall(_wait_for_boot) -- cgit