in my custom extension I'm using the MDC (Mapped Diagnostic Context) to store data for logging purposes. I have successfully put data in the MDC within a class, but when I try to access the same data in another class(in the given extension), it is returning null.
This class implemets JsonProvider
@RequiredArgsConstructor
@ApplicationScoped
public class JsonLogProvider implements JsonProvider {
@Override
public void writeTo(final JsonGenerator generator, final ExtLogRecord event) throws IOException {
event.getMdc("myField"); //the value is NULL
}
I have verified that the thread context is different when attempting to access the MDC data in the second class.
Hi,
in my custom extension I'm using the MDC (Mapped Diagnostic Context) to store data for logging purposes. I have successfully put data in the MDC within a class, but when I try to access the same data in another class(in the given extension), it is returning
null
.This class implemets
JsonProvider
I have verified that the thread context is different when attempting to access the MDC data in the second class.