Ring middleware functions and helpers.
Ring middleware functions and helpers.
(traffic-log-middleware
handler
{:keys [request-logger response-logger exception-logger]
:or {request-logger (fn [request])
response-logger (fn [request response duration-millis])
exception-logger (fn [request exception duration-millis])}
:as options})
Ring middleware that logs request/response/exception using corresponding callback handlers. Options:
Kwarg | Value type | Description | Default |
---|---|---|---|
:request-logger | (fn [request]) | Request logger function | No-op |
:response-logger | (fn [request response ^double duration-millis]) | Response logger function | No-op |
:exception-logger | (fn [request exception ^double duration-millis]) | Exception logger function | No-op |
Ring middleware that logs request/response/exception using corresponding callback handlers. Options: | Kwarg | Value type | Description | Default | |-------------------|--------------------------------------------------|---------------------------|---------| |`:request-logger` |`(fn [request])` | Request logger function | No-op | |`:response-logger` |`(fn [request response ^double duration-millis])` | Response logger function | No-op | |`:exception-logger`|`(fn [request exception ^double duration-millis])`| Exception logger function | No-op |
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close