In the latest version (0.2.4) of tools.logging, when logging with (error some-exception), only the exception message is logged. I depend on having the stack trace printed when an exception is logged. Printing the exception to stderr or stdout is not an option.
As far as I can see in the source, (error ...) does take an exception as the first argument.
(log/error throwable error-message)
What can I do to include the stack traces when logging?
The signature of error is:
(defmacro error
"Error level logging using print-style args."
{:arglists '([message & more] [throwable message & more])}
[& args]
`(logp :error ~@args))
which means that with just 1 param (as in (error some-exception)
), the parameter is the message (which in your case is the toString
of some-exception).
If you want to log the stacktrace you need a second param message like:
(def ex (RuntimeException. "ex"))
(error ex "Something broke!")
or
(error ex ex)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With