metricq-python icon indicating copy to clipboard operation
metricq-python copied to clipboard

Add `--syslog` parameter

Open bmario opened this issue 1 year ago • 2 comments

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

bmario avatar Aug 30 '24 14:08 bmario

There is the syslog2 python package that provides a SyslogLogHandler.

This takes several arguments, which are interesting.

  • address should be parsed from the argument provided by the user to --syslog
    • Nothing -> address == "local"
    • A string in the hostname:port format -> address == value.split(":")
    • A string representing a path -> address == value
    • Anything else: error
  • facility should probably be set "daemon" or "user"
  • program should be the MetricQ token, this might turn out as impossible

bmario avatar Oct 02 '24 14:10 bmario

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.

bmario avatar Oct 08 '24 11:10 bmario