Liking cljdoc? Tell your friends :D

bract.ring.middleware

Ring middleware functions and helpers.

Ring middleware functions and helpers.
raw docstring

traffic-log-middlewareclj

(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:

KwargValue typeDescriptionDefault
:request-logger(fn [request])Request logger functionNo-op
:response-logger(fn [request response ^double duration-millis])Response logger functionNo-op
:exception-logger(fn [request exception ^double duration-millis])Exception logger functionNo-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   |
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close