4 ms·
SLF4J has two ways to do "tagged logging": markers that are passed per-call, and a thread-local mapped diagnostic context (MDC). The latter is useful because yo
by tveita 12y ago
SLF4J has two ways to do "tagged logging": markers that are passed per-call, and a thread-local mapped diagnostic context (MDC). The latter is useful because you can set it for an entire request and have it included even for code that isn't explicitly aware of e.g. accounts.
Unfortunately Go doesn't have thread-local storage, so that feature may not be feasable. (Except through ugly hacks: https://github.com/jtolds/gls https://github.com/jtolds/gls)