(current-context)
Returns the current context map, useful if you want to pass it to another process to continue logging with the same context. Note that due to how MDC works, this will only return the context map for the current thread and map keys will be strings, not keywords.
Returns the current context map, useful if you want to pass it to another process to continue logging with the same context. Note that due to how MDC works, this will only return the context map for the current thread and map keys will be strings, not keywords.
(debug msg)
(debug ctx msg)
Debug log, pass message or ctx+message
Debug log, pass message or ctx+message
(debugf & args)
(error msg)
(error exc msg)
(error ctx exc msg)
Log an error message. [msg] [exc msg] [ctx exc msg] Context map can only be provided when passing exception AND message, otherwise, wrap your call in with-context
Log an error message. [msg] [exc msg] [ctx exc msg] Context map can only be provided when passing exception AND message, otherwise, wrap your call in with-context
(errorf & args)
(info msg)
(info ctx msg)
Log an info pass message or ctx+messag
Log an info pass message or ctx+messag
(infof & args)
(mdc-put ctx)
(mdc-remove ctx)
(not-blank? v)
(timing)
Returns a map of:
This is useful if you want to instrument a function and return the time it took to run it and inject that into the MDC.
Example: (log/with-context {:operation "do-something"} (let [{:keys [_start-time-ms get-run-time-ms]} (timing) result (do-something)] (log/info {:run-time-ms (get-run-time-ms)} "do-something completed") result
Returns a map of: - start-time-ms - get-run-time-ms - returns the time in ms since start-time-ms This is useful if you want to instrument a function and return the time it took to run it and inject that into the MDC. Example: (log/with-context {:operation "do-something"} (let [{:keys [_start-time-ms get-run-time-ms]} (timing) result (do-something)] (log/info {:run-time-ms (get-run-time-ms)} "do-something completed") result
(transform-ctx ctx)
(valid-key? key)
(warn msg)
(warn ctx msg)
Log a warning pass message or ctx+message
Log a warning pass message or ctx+message
(warnf & args)
(with-context ctx & body)
Set context map for the form. The context map should use unqualified keywords or strings for keys. Values will be stringified.
Set context map for the form. The context map should use unqualified keywords or strings for keys. Values will be stringified.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close