Liking cljdoc? Tell your friends :D

service-logging.middleware


add-user-to-contextclj

(add-user-to-context handler)

add-user-to-context is a ring handler that adds the user value from the query string into the context with a key of 'user-info user'. The query params need to be parsed first.

add-user-to-context is a ring handler that adds the user value from the query
string into the context with a key of 'user-info user'. The query params need to be parsed first.
sourceraw docstring

clean-contextclj

(clean-context handler)

Middleware which ensures that the logging context will be restored to its original state prior to the request.

This middleware must be the first middleware in the chain of execution. For example, if used in the thread-first macro, it must be the last middleware.

Middleware which ensures that the logging context will be restored to its original
state prior to the request.

This middleware must be the first middleware in the chain of execution. For example,
if used in the thread-first macro, it must be the last middleware.
sourceraw docstring

flatten-mapclj

(flatten-map form separator pre)

Takes a nested map, and flattens it. The nested keys are combined with the given separator, and the keys can optionally be pre-prended with a string

Takes a nested map, and flattens it. The nested keys are combined with
the given separator, and the keys can optionally be pre-prended with a string
sourceraw docstring

log-requestclj

(log-request {:keys [request-method uri] :as request})
source

log-responseclj

(log-response request response)
(log-response level request response)
(log-response level throwable {:keys [request-method uri]} response)
source

log-response-with-exceptionclj

(log-response-with-exception throwable request response exception)
source

log-validation-errorsclj

(log-validation-errors handler)
source

wrap-loggingclj

(wrap-logging handler)

Logs incoming requests and their responses with the 'AccessLogger' logger.

If the response map contains a throwable key, the value will be given to the logger as an exception/throwable. Also, if the throwable key is not nil, it is assumed that there will also be an exception key in the response map. The throwable and exception keys are not logged nor passed with the response.

Logs incoming requests and their responses with the 'AccessLogger' logger.

If the response map contains a `throwable` key, the value will be given to
the logger as an exception/throwable. Also, if the `throwable` key is not nil,
it is assumed that there will also be an `exception` key in the response map.
The `throwable` and `exception` keys are not logged nor passed with the response.
sourceraw docstring

wrap-response-loggingclj

(wrap-response-logging handler)

Logs incoming requests and their responses with the 'AccessLogger' logger.

If the response map contains a throwable key, the value will be given to the logger as an exception/throwable. Also, if the throwable key is not nil, it is assumed that there will also be an exception key in the response map. The throwable and exception keys are not logged nor passed with the response.

Logs incoming requests and their responses with the 'AccessLogger' logger.

If the response map contains a `throwable` key, the value will be given to
the logger as an exception/throwable. Also, if the `throwable` key is not nil,
it is assumed that there will also be an `exception` key in the response map.
The `throwable` and `exception` keys are not logged nor passed with the response.
sourceraw docstring

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

× close