logback-gelf
logback-gelf copied to clipboard
Add the possibility to filter included MDC keys
Using logback-gelf with spring-cloud-sleuth works just fine, and I can index sleuth fields like "traceId" and "spanId" on every log. But for some reason sleuth duplicates the values on two different MDC entries, traceId -> X-B3-TraceId and spanId -> X-B3-SpanId (and other undesired MDC entries).
Having the possibility to filter the MDC data that is included will be interesting for this and other cases I think.
Those legacy MDC fields were removed in sleuth 3.0.0. See https://github.com/spring-cloud/spring-cloud-sleuth/issues/1221.
Version 4 introduced MdcDataFieldMapper that can be used to programmatically add any kind of filtering logic.
I'm closing this issue because filtering can be easily added by custom field mappers (implemented like the mentioned MdcDataFieldMapper) and I do not want to further increase the complexity if not required.