Verified Commit 7639867d authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

Provide logs to api's syslog

We want to send the logs there (as well as other places), because its
where we take it to the graphana logging stuff.

The API has a bit broken syslog, so we do it through some little unusual
tricks.
parent 5d263480
......@@ -9,6 +9,7 @@ port: 5678
port_compression: 5679
; The logging format. See http://docs.python.org/2/library/logging.html
log_format: %(name)s@%(module)s:%(lineno)s %(asctime)s %(levelname)s %(message)s
syslog_format: ucollect: %(name)s@%(module)s:%(lineno)s %(asctime)s %(levelname)s %(message)s
; Severity of the logs. One of TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL
log_severity: TRACE
; Where to log. - means stderr.
......
......@@ -48,7 +48,8 @@ if log_file != '-':
handler.setFormatter(logging.Formatter(fmt=master_config.get('log_format')))
logging.getLogger().addHandler(handler)
handler_syslog = logging.handlers.SysLogHandler(address="/dev/log")
handler_syslog = logging.handlers.SysLogHandler(address=('localhost', 514))
handler_syslog.setFormatter(logging.Formatter(fmt=master_config.get('syslog_format')))
logging.getLogger().addHandler(handler_syslog)
loaded_plugins = {}
......
Supports Markdown
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