]> git.ipfire.org Git - oddments/ddns.git/commitdiff
Enable logging to syslog/journald.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Jun 2014 23:33:00 +0000 (01:33 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Jun 2014 23:38:43 +0000 (01:38 +0200)
src/ddns/__init__.py

index 553a3fc42ece23c0f2446cf58d8d984ccd31f734..bdbb1117bbcf9488593f82045ad79cf1bc93c141 100644 (file)
@@ -37,7 +37,11 @@ def setup_logging():
        rootlogger.setLevel(logging.INFO)
 
        # Setup a logger that logs to syslog.
-       #handler = logging.handlers.SysLogHandler(address="/dev/log")
+       handler = logging.handlers.SysLogHandler(address="/dev/log",
+               facility=logging.handlers.SysLogHandler.LOG_DAEMON
+       )
+       handler.setLevel(logging.INFO)
+       rootlogger.addHandler(handler)
 
        handler = logging.StreamHandler()
        rootlogger.addHandler(handler)