log4rs
log4rs copied to clipboard
Add support for Key-Value pairs
Hi there,
As discussed in #329, this PR implements support for the log::kv structured logging API.
These are some user-facing choices I have made:
- Everything is implemented behind a
log_kvfeature - Support is added in the two encoders
jsonandpattern:- The
jsonmessage has anattributesfield which is a serialized map of the record's structured logs - The
patternencoder has a newKorkey_valueformatter which functions exactly like themdcformatter.
- The
If this sounds okay, I can also edit the documentation.