[Feature Request]: Support slf4j MDC within DataflowWorkerLoggingHandler
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
### What would you like to happen?
Since the Dataflow documentation suggests to use Slf4j for logging it would only make sense that Dataflow would also log the `org.slf4j.MDC` key value pairs into the JSON logging object.
This could look something like this:
```java
Map mdc = MDC.getCopyOfContextMap();
if(!mdc.isEmpty() {
generator.writeFieldName("mdc");
generator.writeStartObject();
for(Entry entry : mdc.entrySet()) {
generator.writeStringField(entry.getKey(), entry.getValue());
}
generator.writeEndObject();
}
```
If this is an accepted feature I would be willing to work on this.
### Issue Priority
Priority: 2
### Issue Component
Component: runner-dataflow
Contributor guide
Assessment
This issue has not been assessed yet.