logback-gelf icon indicating copy to clipboard operation
logback-gelf copied to clipboard

Add the possibility to filter included MDC keys

Open fabiojb opened this issue 4 years ago • 2 comments

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.

fabiojb avatar Feb 16 '21 00:02 fabiojb

Those legacy MDC fields were removed in sleuth 3.0.0. See https://github.com/spring-cloud/spring-cloud-sleuth/issues/1221.

osiegmar avatar Feb 16 '21 06:02 osiegmar

Version 4 introduced MdcDataFieldMapper that can be used to programmatically add any kind of filtering logic.

osiegmar avatar Oct 17 '21 17:10 osiegmar

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.

osiegmar avatar Dec 23 '22 17:12 osiegmar