(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 msg context)
Similar to clojure.tools.logging/debug. but with optional MDC context arg.
Similar to clojure.tools.logging/debug. but with optional MDC context arg.
(debugf msg & args)
Same as clojure.tools.logging/debugf.
Same as clojure.tools.logging/debugf.
(error msg)
(error exc msg)
(error exc msg ctx)
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 msg & args)
Same as clojure.tools.logging/errorf.
Same as clojure.tools.logging/errorf.
(info msg)
(info msg context)
Similar to clojure.tools.logging/info. but with optional MDC context arg.
Similar to clojure.tools.logging/info. but with optional MDC context arg.
(infof msg & args)
Same as clojure.tools.logging/infof.
Same as clojure.tools.logging/infof.
(log level msg)
(log level msg context?)
Log wrapper which is helpful if you need to programatically control the log level
Log wrapper which is helpful if you need to programatically control the log level
(logf level msg & args)
Log wrapper which is helpful if you need to programatically control the log level.
Log wrapper which is helpful if you need to programatically control the log level.
(mdc-put ctx)
Take a context map and put it into the MDC. Keys and values will be stringified.
Take a context map and put it into the MDC. Keys and values will be stringified.
(trace msg)
(trace msg context)
Similar to clojure.tools.logging/trace. but with optional MDC context arg.
Similar to clojure.tools.logging/trace. but with optional MDC context arg.
(tracef msg & args)
Same as clojure.tools.logging/tracef.
Same as clojure.tools.logging/tracef.
(warn msg)
(warn msg context)
Similar to clojure.tools.logging/warn. but with optional MDC context arg.
Similar to clojure.tools.logging/warn. but with optional MDC context arg.
(warnf msg & args)
Same as clojure.tools.logging/warnf.
Same as clojure.tools.logging/warnf.
(with-context ctx & body)
Set context map for the form. Ideally, the context map should use unqualified keywords or strings for keys. Values will be stringified.
Set context map for the form. Ideally, the context map should use unqualified keywords or strings for keys. Values will be stringified.
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |