Daemon now logs to syslog.

This commit is contained in:
sfigato 2019-01-28 22:25:55 +01:00 committed by blallo
parent 9a99020709
commit fdb0977353
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F

View File

@ -22,9 +22,11 @@ logging.basicConfig(
format="%(levelname)s: [%(name)s] -> %(message)s",
)
syslog = logging.handlers.SysLogHandler()
syslog = logging.handlers.SysLogHandler(address="/dev/log")
syslog.setFormatter(logging.Formatter("%(levelname)s: [%(name)s] -> %(message)s"))
logger = logging.getLogger(__name__)
logger.setLevel(os.environ.get("BOTZ_LOGLEVEL", logging.INFO))
logger.addHandler(syslog)
logger.debug("Init at debug")