Closed
Description
We noticed that uncaught exceptions in our api were not being logged and found that the default exception handler safe-handler
calls printStackTrace
instead of logging the exception.
A small but useful change might be something like:
(defn safe-handler
"Copy of the version in compojure api that uses log instead of printStackTrace
See https://github.com/metosin/compojure-api/blob/master/src/compojure/api/exception.clj#L13"
[^Exception e _ _]
(clojure.tools.logging/spy :error e) ;; was (.printStackTrace e)
(internal-server-error {:type "unknown-exception"
:class (.getName (.getClass e))}))