Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a logfmt formatter #53

Open
ltrzesniewski opened this issue May 5, 2022 · 0 comments
Open

Add a logfmt formatter #53

ltrzesniewski opened this issue May 5, 2022 · 0 comments

Comments

@ltrzesniewski
Copy link
Member

ltrzesniewski commented May 5, 2022

Add a LogfmtFormatter which produces logfmt output, for easy parsing by log aggregators.

This would output some standard fields. Make their keys configurable through init-only properties with suitable defaults. Suppress them if the configured key is null or empty.

Append metadata as their own key/value pairs.

Open questions:

  • What keys should we use for the standard fields by default? Proposal: date, level, thread (or none by default?), logger ,msg
  • In what order should we output the standard fields? Same order as above?
  • How do we escape double quotes in values? With \"?
  • What about multiline values?
  • What if a metadata key contains a space or other character that needs escaping? Or even a newline? Maybe just drop it?
  • How to output exceptions? Just the message or the whole (multiline) stack trace?
  • What date format to use? yyyy-MM-dd HH:mm:ss.fffffff?

/cc @oktal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant