Commit 443eb6e2 authored by Sébastien's avatar Sébastien

syslog désactivé

parent cd065e5a
......@@ -6,7 +6,7 @@ After=syslog.target network.target
Type=simple
User=osinfo
Group=osinfo
ExecStart=/opt/osinfo/server.py
ExecStart=/usr/bin/python3 /opt/osinfo/server.py
[Install]
WantedBy=multi-user.target
......
......@@ -39,20 +39,10 @@ def setup_logging(options):
root.setLevel(logging.WARNING)
LOG.setLevel(options.debug and logging.DEBUG or logging.INFO)
if not options.silent:
if not sys.stderr.isatty():
facility = logging.handlers.SysLogHandler.LOG_DAEMON
sh = logging.handlers.SysLogHandler(address='/dev/log',
facility=facility)
sh.setFormatter(logging.Formatter(
"{0}[{1}]: %(message)s".format(
LOG.name,
os.getpid())))
root.addHandler(sh)
else:
ch = logging.StreamHandler()
ch.setFormatter(logging.Formatter(
"%(levelname)s[%(name)s] %(message)s"))
root.addHandler(ch)
ch = logging.StreamHandler()
ch.setFormatter(logging.Formatter(
"%(levelname)s[%(name)s] %(message)s"))
root.addHandler(ch)
def main(host="0.0.0.0", port=7777):
"""Va retourner les informations suivantes sur une même ligne,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment