Skip to content

JSON format log output #3246

Closed
Closed
@linuswillner

Description

@linuswillner

Is your feature request related to a problem? Please elaborate.

Using this bot with log aggregation services like Coralogix is currently less than optimal, because the log outputs are free text and not JSON. This means that, to identify log levels from log messages, we need to regex lines individually, which is brittle and prone to miscategorisation. Multiline log messages, e.g. stack traces, also get interpreted as separate messages, which further exacerbates the miscategorisation issue. For stack traces, this means that most of the stack trace gets incorrectly labelled as info, since it’s not realistically possible to tell a log aggregation service what is and is not part of the stack trace with just regex - or at least it isn't possible with any semblance of reasonable accuracy.

Furthermore, if one has some sort of conditional alert forwarding system, e.g. the one provided by Coralogix, preventing non-actionable issues reported as errors (such as the somewhat frequently recurring “ignoring exception in <something>”) from triggering alerts is also difficult because of this. It can be done, but requires a lot of dancing around specific message wordings to avoid overexclusion and thus losing actually relevant alerts.

Describe the solution you'd like

An optional, or preferably enabled-by-default in production deployments, JSON log output format.

Does your solution involve any of the following?

  • Logviewer
  • New config option

Describe alternatives you've considered

The current free text log output format, which works, but is brittle and suboptimal as detailed previously.

Who will this benefit?

Any users who use log aggregation services, and anyone else who wishes to inspect their Modmail process logs in a structured manner.

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions