Class MDC
java.lang.Object
com.codename1.backend.log.MDC
A per-thread context map appended to every line logged on that thread, as slf4j's MDC is: put a request id once and every line of that request carries it.
MDC.put("request", requestId);
try {
handle(request);
} finally {
MDC.remove("request");
}
The map belongs to the thread, a virtual thread included, so a value put by one request is never seen by another. Remove what you put: a pooled thread otherwise carries it into the next request it serves.
-
Method Summary
-
Method Details
-
put
-
get
-
remove
Removeskeyfrom this thread's context. -
clear
public static void clear()Empties this thread's context.
-