about summary refs log tree commit diff
path: root/users/grfn/bbbg/src
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-12-27T03·41-0500
committerclbot <clbot@tvl.fyi>2021-12-27T03·46+0000
commit78f2bf937154339211657a1e62217b6676cb7f5d (patch)
tree4f05bdb7ca7c1550cf9e825eb64269442735faac /users/grfn/bbbg/src
parent784e35bf553bc7f426aa2f663db6d32121431590 (diff)
feat(grfn/bbbg): Add a request logger r/3457
Also update log deps so things actually log, using a new :outdated alias
based on antq

Change-Id: I6f87f474bea101fa1b396c519b234eb3aac1c4f1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4696
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/grfn/bbbg/src')
-rw-r--r--users/grfn/bbbg/src/bbbg/web.clj12
1 files changed, 9 insertions, 3 deletions
diff --git a/users/grfn/bbbg/src/bbbg/web.clj b/users/grfn/bbbg/src/bbbg/web.clj
index 714c5c98370c..f364d734f30f 100644
--- a/users/grfn/bbbg/src/bbbg/web.clj
+++ b/users/grfn/bbbg/src/bbbg/web.clj
@@ -3,19 +3,22 @@
    [bbbg.discord.auth :as discord.auth :refer [wrap-discord-auth]]
    [bbbg.handlers.attendee-checks :as attendee-checks]
    [bbbg.handlers.attendees :as attendees]
-   [bbbg.handlers.core :refer [wrap-dynamic-auth wrap-current-uri]]
+   [bbbg.handlers.core :refer [wrap-current-uri wrap-dynamic-auth]]
    [bbbg.handlers.events :as events]
    [bbbg.handlers.home :as home]
    [bbbg.handlers.signup-form :as signup-form]
    [bbbg.styles :refer [stylesheet]]
    [bbbg.util.core :as u]
    [bbbg.views.flash :refer [wrap-page-flash]]
+   [cambium.core :as log]
    clj-time.coerce
+   [clojure.java.io :as io]
    [clojure.spec.alpha :as s]
    [com.stuartsierra.component :as component]
    [compojure.core :refer [GET routes]]
    [config.core :refer [env]]
    [org.httpkit.server :as http-kit]
+   [ring.logger :refer [wrap-with-logger]]
    [ring.middleware.flash :refer [wrap-flash]]
    [ring.middleware.keyword-params :refer [wrap-keyword-params]]
    [ring.middleware.multipart-params :refer [wrap-multipart-params]]
@@ -23,8 +26,7 @@
    [ring.middleware.resource :refer [wrap-resource]]
    [ring.middleware.session :refer [wrap-session]]
    [ring.middleware.session.cookie :refer [cookie-store]]
-   [ring.util.response :refer [content-type response]]
-   [clojure.java.io :as io])
+   [ring.util.response :refer [content-type response]])
   (:import
    java.util.Base64))
 
@@ -89,6 +91,10 @@
 (defn middleware [app env]
   (-> app
       (wrap-resource "public")
+      (wrap-with-logger
+       {:log-fn
+        (fn [{:keys [level throwable message]}]
+          (log/log level {} throwable message))})
       wrap-current-uri
       wrap-dynamic-auth
       (wrap-discord-auth env)