metricq-python
metricq-python copied to clipboard
Add `--syslog` parameter
Depends on #188
- [ ] Parameter
--syslog-> enables directly logging to syslog server and optionally argument the targeted syslog server (instead of default syslog socket) - [ ] Enable as optional feature
There is the syslog2 python package that provides a SyslogLogHandler.
This takes several arguments, which are interesting.
addressshould be parsed from the argument provided by the user to--syslog- Nothing ->
address == "local" - A string in the
hostname:portformat ->address == value.split(":") - A string representing a path ->
address == value - Anything else: error
- Nothing ->
facilityshould probably be set "daemon" or "user"programshould be the MetricQ token, this might turn out as impossible
There is also the standard lib version here: https://docs.python.org/3/library/logging.handlers.html#logging.handlers.SysLogHandler
That might be more than enough for our use case already.