chiark / gitweb /
syslog handling: print tracebacks when logging failure objects
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 Apr 2017 19:51:06 +0000 (20:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 Apr 2017 19:51:06 +0000 (20:51 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
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')