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
Add a
LogfmtFormatterwhich 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:
date,level,thread(or none by default?),logger,msg\"?yyyy-MM-dd HH:mm:ss.fffffff?/cc @oktal