<div dir="ltr">Hi,<div><br></div><div>I've been looking through the issue tracker and I've found that there is a 2.0 release planned which would include some API changes.</div><div><br></div><div>I've been working a lot with Graylog lately, and am of the opinion that SLF4J's API doesn't really cover that use case in a way that feels natural, so I'd like to know if such structured logging approaches could be covered in the new release.</div><div><br></div><div>For example, besides the regular message, Graylog supports adding custom fields to logs.</div><div>Although this is supported by SLF4J through MDC, sometimes you only need the one log statement with a given field, in which case MDC is inconvenient because you'd need to:</div><div><br></div><div>1. Add the value to the MDC</div><div>2. Log</div><div>3. Remove the value</div><div><br></div><div>One way I can think of doing this is replacing the formatted approach, i.e.:</div><div><br></div><div>  <a href="http://log.info">log.info</a>("This is a message with {}", "some value");</div><div><br></div><div>with </div><div><br></div><div>  <a href="http://log.info">log.info</a>("This is a message", singletonMap("value", "some value"));</div><div><br></div><div>I think this fits the structured logging model more naturally but is also suited for logging to file/stdout if you add a fields marker to formatters (similar to the one in MDC).</div><div><br></div><div>Any opinions on this?</div><div><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">João Cabrita</div></div></div>
</div></div>