Our logs put one order's email failure under another order's number because a pooled thread remembered it
java
dev.to
Our order service puts the order number into every log line through the logging context, the MDC, so that one search shows everything that happened to an order. A servlet filter puts the number in when a request arrives and clears it when the response goes out. On the request thread that works perfectly. In September we moved label printing and customer emails off the request path into a Spring thread pool, so checkout would not wait for them. Two weeks later a customer complained that her conf