Skip to content

Refactor logging

Eevans requested to merge eevans/corto:refactor_logging into main

The logger from servicelib-golang logs json to stdout using an ecs schema. These log lines can be forwarded to logstash (via rsyslog) and indexed by opensearch. However, the ircbot package already logs, logging that it inherits from github.com/whyrusleeping/hellabot. There doesn't appear to be any way to pass our logger, or even configure the included log15-based one, short of patching ircbot and/or hellabot.

Using our logger instance from within the command handlers results in having ircbot's human friendly output (colorized even!) interleved with the json-formatted lines we output. This is unsuitable for logstash, and hard for humands to read.

The easiest solution is to use ircbots logger.

Merge request reports