Yaniv Bronhaim has uploaded a new change for review.

Change subject: Redirect stderr to syslog prints
......................................................................

Redirect stderr to syslog prints

Otherwise, assert statements won't appear in syslog, and it allows
reporting if vdsm log file is corrupted.

Change-Id: Icbdc151f174223e7b54e9dec221c3cd2868b536d
Signed-off-by: Yaniv Bronhaim <[email protected]>
---
M vdsm/vdsm
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/9822/1

diff --git a/vdsm/vdsm b/vdsm/vdsm
index 8df24fb..238dd94 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -10,6 +10,7 @@
 
 import os
 import sys
+import syslog
 import getopt
 import signal
 import getpass
@@ -31,6 +32,17 @@
 loggerConfFile = constants.P_VDSM_CONF + 'logger.conf'
 
 
+# redirect strerr to syslog
+class syslogPrinter(object):
+
+    syslog.openlog('vdsm')
+
+    def write(self, data):
+        syslog.syslog(data)
+
+sys.stderr = syslogPrinter()
+
+
 def usage():
     print "Usage:  vdsm [OPTIONS]"
     print "     -h  - Display this help message"


--
To view, visit http://gerrit.ovirt.org/9822
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbdc151f174223e7b54e9dec221c3cd2868b536d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to