Open ntvf opened 4 years ago
Interesting take on this one. Does it support multiple "structured arguments" too or only a single map? I don't understand how the formatting of the map for the message itself works – wouldn't that be {duration=12}
in the message?
Nevermind, I saw only now that duration
is passed once directly as argument and then as context map parameter.
Inspired by Context Map feature from logstash-logback-encoder for adding event-specific custom fields to message. Example: Log line: log.info("Service started in {} seconds", duration/1000, Collections.singletonMap("duration", duration));
Result: { "@timestamp": "2014-06-04T15:26:14.464+02:00", "message": "Service started in 12 seconds", "duration": 12368, }