log4rs icon indicating copy to clipboard operation
log4rs copied to clipboard

Add support for Key-Value pairs

Open ellttBen opened this issue 1 year ago • 12 comments

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_kv feature
  • Support is added in the two encoders json and pattern:
    • The json message has an attributes field which is a serialized map of the record's structured logs
    • The pattern encoder has a new K or key_value formatter which functions exactly like the mdc formatter.

If this sounds okay, I can also edit the documentation.

ellttBen avatar Mar 20 '24 07:03 ellttBen