Simple Clojure logging facade for logging structured data via SLF4J 2+.
Simple Clojure logging facade for logging structured data via SLF4J 2+.
Logging context. A structured alternative to the MDC that is thread safe and nicer to use from Clojure. (You can still use the MDC if you like.)
Everything in here in scope of the log statement will be included in the log. Try to use fully qualified keywords to avoid naming conflicts with the core log data.
Why an atom AND a dynamic var? The dynamic var allows this value to differentiate between threads and dynamic scope, while the atom provides safe alteration and the ability to set global context values.
Logging context. A structured alternative to the [MDC][] that is thread safe and nicer to use from Clojure. (You can still use the MDC if you like.) [MDC]: https://logback.qos.ch/manual/mdc.html Everything in here in scope of the log statement will be included in the log. Try to use fully qualified keywords to avoid naming conflicts with the core log data. --- Why an atom AND a dynamic var? The dynamic var allows this value to differentiate between threads and dynamic scope, while the atom provides safe alteration and the ability to set global context values.
(debug msg data & {:keys [cause markers logger-ns]})Log a message and accompanying data at the :debug logging level.
The log will include anything in com.kroo.epilogue/*context* within the
current dynamic scope.
data can be anything that implements the clojure.core.protocols/IKVReduce
protocol, but it is recommended to log only maps to avoid confusion.
Options:
cause,markers (or strings/keywords), andlogger-ns).Log a message and accompanying data at the `:debug` logging level. The log will include anything in `com.kroo.epilogue/*context*` within the current dynamic scope. `data` can be anything that implements the `clojure.core.protocols/IKVReduce` protocol, but it is recommended to log only maps to avoid confusion. Options: - a throwable object as the `cause`, - a sequence of SLF4J `markers` (or strings/keywords), and - an override logger namespace (`logger-ns`).
(defloggingmacro name doc-string? attr-map? [params*] body)(defloggingmacro name doc-string? attr-map? ([params*] body) + attr-map?)Defines a macro that preserves the original line number and column making it
suitable for logging. Otherwise behaves identically to defmacro.
Defines a macro that preserves the original line number and column making it suitable for logging. Otherwise behaves identically to `defmacro`.
(error msg data & {:keys [cause markers logger-ns]})Log a message and accompanying data at the :error logging level.
The log will include anything in com.kroo.epilogue/*context* within the
current dynamic scope.
data can be anything that implements the clojure.core.protocols/IKVReduce
protocol, but it is recommended to log only maps to avoid confusion.
Options:
cause,markers (or strings/keywords), andlogger-ns).Log a message and accompanying data at the `:error` logging level. The log will include anything in `com.kroo.epilogue/*context*` within the current dynamic scope. `data` can be anything that implements the `clojure.core.protocols/IKVReduce` protocol, but it is recommended to log only maps to avoid confusion. Options: - a throwable object as the `cause`, - a sequence of SLF4J `markers` (or strings/keywords), and - an override logger namespace (`logger-ns`).
(info msg data & {:keys [cause markers logger-ns]})Log a message and accompanying data at the :info logging level.
The log will include anything in com.kroo.epilogue/*context* within the
current dynamic scope.
data can be anything that implements the clojure.core.protocols/IKVReduce
protocol, but it is recommended to log only maps to avoid confusion.
Options:
cause,markers (or strings/keywords), andlogger-ns).Log a message and accompanying data at the `:info` logging level. The log will include anything in `com.kroo.epilogue/*context*` within the current dynamic scope. `data` can be anything that implements the `clojure.core.protocols/IKVReduce` protocol, but it is recommended to log only maps to avoid confusion. Options: - a throwable object as the `cause`, - a sequence of SLF4J `markers` (or strings/keywords), and - an override logger namespace (`logger-ns`).
(log level msg data & {:keys [cause markers logger-ns]})Logs a message and accompanying data at the specified logging level.
The log will include anything in com.kroo.epilogue/*context* within the
current dynamic scope.
data can be anything that implements the clojure.core.protocols/IKVReduce
protocol, but it is recommended to log only maps to avoid confusion.
Options:
cause,markers (or strings/keywords), andlogger-ns).Logs a message and accompanying data at the specified logging level. The log will include anything in `com.kroo.epilogue/*context*` within the current dynamic scope. `data` can be anything that implements the `clojure.core.protocols/IKVReduce` protocol, but it is recommended to log only maps to avoid confusion. Options: - a throwable object as the `cause`, - a sequence of SLF4J `markers` (or strings/keywords), and - an override logger namespace (`logger-ns`).
(log* level msg data cause markers logger-ns src)Primitive logging function for Epilogue.
Do not use this function directly! Use the provided macros instead. Backwards compatibility is not guaranteed for this function.
Primitive logging function for Epilogue. Do not use this function directly! Use the provided macros instead. Backwards compatibility is not guaranteed for this function.
(raise msg data & {:keys [level cause markers logger-ns]})Log and throw. Logs at :error level by default. Constructs and throws a
clojure.lang.ExceptionInfo object.
Log and throw. Logs at `:error` level by default. Constructs and throws a `clojure.lang.ExceptionInfo` object.
(trace msg data & {:keys [cause markers logger-ns]})Log a message and accompanying data at the :trace logging level.
The log will include anything in com.kroo.epilogue/*context* within the
current dynamic scope.
data can be anything that implements the clojure.core.protocols/IKVReduce
protocol, but it is recommended to log only maps to avoid confusion.
Options:
cause,markers (or strings/keywords), andlogger-ns).Log a message and accompanying data at the `:trace` logging level. The log will include anything in `com.kroo.epilogue/*context*` within the current dynamic scope. `data` can be anything that implements the `clojure.core.protocols/IKVReduce` protocol, but it is recommended to log only maps to avoid confusion. Options: - a throwable object as the `cause`, - a sequence of SLF4J `markers` (or strings/keywords), and - an override logger namespace (`logger-ns`).
(warn msg data & {:keys [cause markers logger-ns]})Log a message and accompanying data at the :warn logging level.
The log will include anything in com.kroo.epilogue/*context* within the
current dynamic scope.
data can be anything that implements the clojure.core.protocols/IKVReduce
protocol, but it is recommended to log only maps to avoid confusion.
Options:
cause,markers (or strings/keywords), andlogger-ns).Log a message and accompanying data at the `:warn` logging level. The log will include anything in `com.kroo.epilogue/*context*` within the current dynamic scope. `data` can be anything that implements the `clojure.core.protocols/IKVReduce` protocol, but it is recommended to log only maps to avoid confusion. Options: - a throwable object as the `cause`, - a sequence of SLF4J `markers` (or strings/keywords), and - an override logger namespace (`logger-ns`).
(with-context context & body)Merge context onto the current logging *context*, creating a new scope
around body.
Merge `context` onto the current logging `*context*`, creating a new scope around `body`.
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 |