syslog handling: print tracebacks when logging failure objects
[hippotat] / hippotatd
index e2bed42..b08ce66 100755 (executable)
--- a/hippotatd
+++ b/hippotatd
@@ -375,6 +375,10 @@ def daemonise():
       elif level == LogLevel.warn             : sl = syslog.LOG_WARNING
       else                                    : sl = syslog.LOG_INFO
       syslog.syslog(sl,m)
+      failure = event.get('log_failure')
+      if failure is not None:
+        for l in failure.getTraceback().split('\n'):
+          syslog.syslog(sl,l)
     glp = twisted.logger.globalLogPublisher
     glp.addObserver(emit)
     log_debug(DBG.INIT, 'starting to log to syslog')