Liking cljdoc? Tell your friends :D

dev.arkaitz.web-base.log

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.
raw docstring

mdc-keyclj

source

wrap-request-idclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close