revamped logging!

This commit is contained in:
Bryce Covert
2020-08-01 17:07:17 -07:00
parent 49f98522c0
commit 51b097766f
33 changed files with 598 additions and 485 deletions

View File

@@ -16,6 +16,8 @@
[compojure.core :refer :all]
[compojure.route :as route]
[config.core :refer [env]]
[clojure.tools.logging :as log]
[unilog.context :as lc]
[ring.middleware.edn :refer [wrap-edn-params]]
[ring.middleware.multipart-params :as mp]
[ring.middleware.params :refer [wrap-params]]
@@ -55,10 +57,20 @@
static-routes))
(defn wrap-logging [handler]
(fn [request]
(lc/with-context {:uri (:uri request)
:source "request"
:user-role (:user/role (:identity request))
:user-name (:user/name (:identity request))}
(log/info "Beginning request" (:uri request))
(handler request))))
(def app
(-> #'app-routes
(wrap-logging)
(wrap-authorization auth-backend)
(wrap-authentication auth-backend)
(wrap-reload)