From bf6211903c090c20746f3cf1d20dbfcb70d8b71e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 22 Mar 2022 14:33:27 +0100 Subject: [PATCH] :bug: Fix issue on logging (backend) --- common/src/app/common/logging.cljc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/common/src/app/common/logging.cljc b/common/src/app/common/logging.cljc index ba2598853..d0ce43f5c 100644 --- a/common/src/app/common/logging.cljc +++ b/common/src/app/common/logging.cljc @@ -184,11 +184,15 @@ `(do (send-off logging-agent (fn [_#] - (with-context (into {:id (uuid/next)} - (get-error-context ~cause) - ~context) - (->> (or ~raw (build-map-message ~props)) - (write-log! ~logger-sym ~level-sym ~cause))))) + (try + (with-context (-> {:id (uuid/next)} + (into ~context) + (into (get-error-context ~cause))) + (->> (or ~raw (build-map-message ~props)) + (write-log! ~logger-sym ~level-sym ~cause))) + (catch Throwable cause# + (write-log! ~logger-sym (get-level :error) cause# + "unexpected error on writting log"))))) nil) `(let [message# (or ~raw (build-map-message ~props))] (write-log! ~logger-sym ~level-sym ~cause message#)