Skip to content

Conversation

@srebhan
Copy link
Member

@srebhan srebhan commented Aug 16, 2024

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

  • No AI generated code was used in this PR

Related issues

resolves #8815

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Aug 16, 2024
@srebhan srebhan added area/logging ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Aug 21, 2024
@srebhan srebhan assigned mstrandboge and powersj and unassigned srebhan Aug 21, 2024
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. My only question is around the config option values.

@srebhan
Copy link
Member Author

srebhan commented Aug 29, 2024

We should introduce a new logformat option and completely the logtarget one completely instead of reusing it.

@mstrandboge mstrandboge assigned srebhan and unassigned mstrandboge Aug 30, 2024
@srebhan srebhan requested review from Hipska and powersj September 2, 2024 16:18
@srebhan srebhan assigned mstrandboge and unassigned srebhan Sep 2, 2024
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
@mstrandboge mstrandboge merged commit c3e5319 into influxdata:master Sep 6, 2024
@github-actions github-actions bot added this to the v1.32.0 milestone Sep 6, 2024
asaharn pushed a commit to asaharn/telegraf that referenced this pull request Oct 16, 2024
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/logging feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

4 participants