Change in vdsm[master]: virt: logging: introduce the Virt logger

fromani at redhat.com fromani at redhat.com
Mon Jun 22 15:42:36 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: virt: logging: introduce the Virt logger
......................................................................

virt: logging: introduce the Virt logger

Add the 'Virt' top level logger, to
make it easier to separate the logging messages.

Change-Id: I5ea35e484148613d5714f6dd9703fbe27446524f
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/logger.conf.in
M vdsm/virt/periodic.py
M vdsm/virt/sampling.py
M vdsm/virt/vm.py
M vdsm/virt/vmtune.py
5 files changed, 13 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/42687/1

diff --git a/vdsm/logger.conf.in b/vdsm/logger.conf.in
index 013045a..dcecc24 100644
--- a/vdsm/logger.conf.in
+++ b/vdsm/logger.conf.in
@@ -1,5 +1,5 @@
 [loggers]
-keys=root,vds,Storage,ovirt_hosted_engine_ha,IOProcess,connectivity
+keys=root,vds,Storage,Virt,ovirt_hosted_engine_ha,IOProcess,connectivity
 
 [handlers]
 keys=console,syslog,logfile,connlogfile
@@ -42,6 +42,12 @@
 qualname=connectivity
 propagate=0
 
+[logger_Virt]
+level=DEBUG
+handlers=logfile
+qualname=Virt
+propagate=0
+
 [handler_syslog]
 level=WARNING
 class=handlers.SysLogHandler
diff --git a/vdsm/virt/periodic.py b/vdsm/virt/periodic.py
index 3f901e3..76df45e 100644
--- a/vdsm/virt/periodic.py
+++ b/vdsm/virt/periodic.py
@@ -126,7 +126,7 @@
     It would be called again even if a former call is blocked.
     """
 
-    _log = logging.getLogger("periodic.Operation")
+    _log = logging.getLogger("Virt.periodic.Operation")
 
     def __init__(self, func, period, timeout=0,
                  scheduler=None, executor=None):
@@ -205,7 +205,7 @@
     isolation among them.
     """
 
-    _log = logging.getLogger("periodic.VmDispatcher")
+    _log = logging.getLogger("Virt.periodic.VmDispatcher")
 
     def __init__(self, get_vms, executor, create, timeout):
         """
diff --git a/vdsm/virt/sampling.py b/vdsm/virt/sampling.py
index a5b69f0..fded994 100644
--- a/vdsm/virt/sampling.py
+++ b/vdsm/virt/sampling.py
@@ -405,7 +405,7 @@
     between a well behaving call and an unblocked stuck call.
     """
 
-    _log = logging.getLogger("sampling.StatsCache")
+    _log = logging.getLogger("Virt.sampling.StatsCache")
 
     def __init__(self, clock=utils.monotonic_time):
         self._clock = clock
@@ -506,7 +506,7 @@
         self._stats_flags = stats_flags
         self._skip_doms = ExpiringCache(timeout)
         self._sampling = threading.Semaphore()  # used as glorified counter
-        self._log = logging.getLogger("sampling.VMBulkSampler")
+        self._log = logging.getLogger("Virt.sampling.VMBulkSampler")
 
     def __call__(self):
         timestamp = self._stats_cache.clock()
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index eabec1d..dbfea94 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -240,7 +240,7 @@
     its behaviour.
     """
 
-    log = logging.getLogger("vm.Vm")
+    log = logging.getLogger("Virt.vm.Vm")
     # limit threads number until the libvirt lock will be fixed
     _ongoingCreations = threading.BoundedSemaphore(4)
     DeviceMapping = ((hwclass.DISK, vmdevices.storage.Drive),
diff --git a/vdsm/virt/vmtune.py b/vdsm/virt/vmtune.py
index 23ebe61..da86e92 100644
--- a/vdsm/virt/vmtune.py
+++ b/vdsm/virt/vmtune.py
@@ -25,7 +25,7 @@
 
 from . import vmxml
 
-log = logging.getLogger(__name__)
+log = logging.getLogger('Virt.vmtune')
 
 
 def io_tune_values_to_dom(values, dom):


-- 
To view, visit https://gerrit.ovirt.org/42687
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ea35e484148613d5714f6dd9703fbe27446524f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list