Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: systemd: Use journal
......................................................................

systemd: Use journal

Instead of using ovirt-node.log use systemd.

Change-Id: I179369a84149ac1010e6a25fee60dedc17c6d508
Signed-off-by: Douglas Schilling Landgraf <dougsl...@redhat.com>
---
M autoinstall/ovirt-node-plugin-vdsm-autoreg
M ovirt-node-plugin-vdsm.spec.in
2 files changed, 14 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node-plugin-vdsm 
refs/changes/08/42008/1

diff --git a/autoinstall/ovirt-node-plugin-vdsm-autoreg 
b/autoinstall/ovirt-node-plugin-vdsm-autoreg
index 2e3e06f..302c6e0 100644
--- a/autoinstall/ovirt-node-plugin-vdsm-autoreg
+++ b/autoinstall/ovirt-node-plugin-vdsm-autoreg
@@ -25,12 +25,12 @@
 from ovirt.node.setup.vdsm import engine_page
 from ovirt.node.utils import system
 
+from systemd import journal
 
 class AutoRegister(object):
 
     def __init__(self):
-        # Log: /var/log/ovirt-node.log
-        self.logger = log.getLogger(__name__)
+        self.logger = self._set_logger()
 
         # For autoinstall using check-fqdn = False as previous autoinstall
         # doesn't check CA cert
@@ -40,6 +40,17 @@
         self.mserver = None
         self.mserver_port = None
 
+    def _set_logger():
+        """
+        Set the logging schema
+        """
+        log = logging.getLogger(__name__)
+        log.propagate = False
+        log.setLevel(logging.DEBUG)
+        log.addHandler(
+            journal.JournalHandler(SYSLOG_IDENTIFIER='ovirt-node-plugin-vdsm')
+        )
+
     def _is_karg_set(self, key, debug=True):
         """
         Check if the key was used as kernel argument
diff --git a/ovirt-node-plugin-vdsm.spec.in b/ovirt-node-plugin-vdsm.spec.in
index 76ad144..ef55004 100644
--- a/ovirt-node-plugin-vdsm.spec.in
+++ b/ovirt-node-plugin-vdsm.spec.in
@@ -14,6 +14,7 @@
 URL:            http://www.ovirt.org/
 Requires:       ovirt-node >= 3.0.4
 Requires:       python
+Requires:       systemd-python
 Requires:       vdsm-reg >= 4.10.3
 Requires:       ovirt-host-deploy-offline >= 1.3.0
 %if ! 0%{?rhel}


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I179369a84149ac1010e6a25fee60dedc17c6d508
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node-plugin-vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsl...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to