A request id threaded through one request (SPEC §6): on the request as
:wb/request-id, on the response as X-Request-Id, in the SLF4J MDC as
request-id for the duration, and in one access line. The base ships no
logging backend — a library must not — so the line goes through
tools.logging and the MDC key reaches whatever pattern the host configures
(%X{request-id} in logback).
An incoming X-Request-Id is not trusted: a client could then choose what
the logs say. Behind a proxy that assigns ids, the host maps them.
A request id threaded through one request (SPEC §6): on the request as
`:wb/request-id`, on the response as `X-Request-Id`, in the SLF4J MDC as
`request-id` for the duration, and in one access line. The base ships no
logging backend — a library must not — so the line goes through
tools.logging and the MDC key reaches whatever pattern the host configures
(`%X{request-id}` in logback).
An incoming `X-Request-Id` is not trusted: a client could then choose what
the logs say. Behind a proxy that assigns ids, the host maps them.(wrap-request-id handler)The outermost middleware: every response, including a 404 or a static asset, carries the id. If the handler throws, the access line still goes out with a 500 and the throwable propagates; the MDC is cleared either way.
The outermost middleware: every response, including a 404 or a static asset, carries the id. If the handler throws, the access line still goes out with a 500 and the throwable propagates; the MDC is cleared either way.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |