Skip to content

Commit

Permalink
[nop] Update community appenders to avoid deprecated stacktrace util
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Feb 27, 2023
1 parent 6e7dfd2 commit 814b49d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/taoensso/timbre/appenders/community/gelf.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@
(.level log-level)
(.timestamp (.getTime instant)))]
(cond-> msg-builder
?err (.fullMessage (timbre/stacktrace ?err {:stacktrace-fonts {}}))
?err
(.fullMessage
(timbre/default-output-error-fn
{:?err ?err
:output-opts {:stacktrace-fonts {}}}))

context (.additionalField "context" context)
?ns-str (.additionalField "namespace" ?ns-str)
?file (.additionalField "file" ?file)
Expand Down
2 changes: 1 addition & 1 deletion src/taoensso/timbre/appenders/community/irclj.clj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(-> level name (str/upper-case))
(or (force msg_) "")
(if-let [err ?err]
(str "\n" (timbre/stacktrace err))
(str "\n" (timbre/default-output-error-fn {:?err err}))
""))))

:fn
Expand Down
10 changes: 7 additions & 3 deletions src/taoensso/timbre/appenders/community/logstash.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@
(defn data->json-stream
[data writer opts]
;; Note: this it meant to target the logstash-filter-json; especially "message" and "@timestamp" get a special meaning there.
(let [stacktrace-str (if-let [pr (:pr-stacktrace opts)]
#(with-out-str (pr %))
#(timbre/stacktrace % {:stacktrace-fonts nil}))]
(let [stacktrace-str
(if-let [pr (:pr-stacktrace opts)]
#(with-out-str (pr %))
#(timbre/default-output-error-fn
{:?err %
:output-opts {:stacktrace-fonts {}}}))]

(cheshire/generate-stream
(merge (:context data)
{:level (:level data)
Expand Down

0 comments on commit 814b49d

Please sign in to comment.