telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

feat(logging): Implement structured logging

Open srebhan opened this issue 6 months ago • 1 comments

Summary

Structured logging is a machine-readable way of outputting logs and useful when automatically processing the produced logs. This PR implements a structured log-target producing JSON formatted structured logs. It is output to a logfile, if specified, or to stderr otherwise similar to the usual text logger. Additionally, the PR deprecates the file and stderr targets and replaces them with a text target as that's what the output is. The decision to use a file or stderr is the done based on the logfile setting

Checklist

  • [x] No AI generated code was used in this PR

Related issues

resolves #8815

srebhan avatar Aug 16 '24 16:08 srebhan