telegraf
telegraf copied to clipboard
feat(logging): Implement structured logging
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