♻️ Refactor logging.

This commit is contained in:
Andrey Antukh 2021-04-06 23:25:34 +02:00
parent 44d64e4831
commit e12a6e65a6
33 changed files with 383 additions and 193 deletions

View file

@ -17,11 +17,11 @@
[app.metrics :as mtx]
[app.util.json :as json]
[app.util.migrations :as mg]
[app.util.logging :as l]
[app.util.time :as dt]
[app.util.transit :as t]
[clojure.java.io :as io]
[clojure.spec.alpha :as s]
[clojure.tools.logging :as log]
[integrant.core :as ig]
[next.jdbc :as jdbc]
[next.jdbc.date-time :as jdbc-dt])
@ -60,7 +60,9 @@
(defmethod ig/init-key ::pool
[_ {:keys [migrations metrics] :as cfg}]
(log/infof "initialize connection pool '%s' with uri '%s'" (name (:name cfg)) (:uri cfg))
(l/info :action "initialize connection pool"
:name (d/name (:name cfg))
:uri (:uri cfg))
(instrument-jdbc! (:registry metrics))
(let [pool (create-pool cfg)]
(when (seq migrations)