diff --git a/project.clj b/project.clj index e329363c9bf8412f8fd4815707c214b842ae78cc..82bb05de3c12970fc7c1208a22f678e4c1ae05d6 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject no.nsd/envelope "0.1.2" +(defproject no.nsd/envelope "0.1.3" :description "A thin wrapper around taoensso.timbre with built in settings for logging to NSD's ELK stack" :url "https://gitlab.nsd.no/clojure/envelope" :license {:name "Eclipse Public License" diff --git a/src/no/nsd/envelope.cljc b/src/no/nsd/envelope.cljc index df276c5e2108c2093bad1c0f6d220bd28b83853a..05c25b4bca9940b744d9fd5a11ea805d9c635261 100644 --- a/src/no/nsd/envelope.cljc +++ b/src/no/nsd/envelope.cljc @@ -62,16 +62,17 @@ [conf] (let [current-conf (swap! envelope-config merge conf) elk? (:log-to-elk current-conf)] - (timbre/merge-config! {:timestamp-opts (if elk? - {:pattern "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"} - {:pattern (:console-time-pattern current-conf) - :timezone :jvm-default}) - :level (or (:level current-conf) - (if elk? :info :debug)) - :output-fn (if elk? - (partial nsd-logstash-format-fn current-conf) - (or (:output-fn current-conf) - local-console-format-fn))}) + (timbre/merge-config! (merge current-conf + {:timestamp-opts (if elk? + {:pattern "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"} + {:pattern (:console-time-pattern current-conf) + :timezone :jvm-default}) + :level (or (:level current-conf) + (if elk? :info :debug)) + :output-fn (if elk? + (partial nsd-logstash-format-fn current-conf) + (or (:output-fn current-conf) + local-console-format-fn))})) current-conf)) @@ -80,6 +81,7 @@ ([] (init! {})) ([conf] #?(:clj (cljlog/use-timbre)) + (reset! envelope-config default-config) (merge-config! (merge default-config conf)) (timbre/debug "Logging envelope initialized")))