Daemon now logs to syslog.
This commit is contained in:
parent
9a99020709
commit
fdb0977353
|
@ -22,9 +22,11 @@ logging.basicConfig(
|
||||||
format="%(levelname)s: [%(name)s] -> %(message)s",
|
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 = logging.getLogger(__name__)
|
||||||
|
logger.setLevel(os.environ.get("BOTZ_LOGLEVEL", logging.INFO))
|
||||||
logger.addHandler(syslog)
|
logger.addHandler(syslog)
|
||||||
logger.debug("Init at debug")
|
logger.debug("Init at debug")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user