diff --git a/backend/src/app/db.clj b/backend/src/app/db.clj index d2b6f7cc1..d1debe094 100644 --- a/backend/src/app/db.clj +++ b/backend/src/app/db.clj @@ -5,7 +5,7 @@ ;; This Source Code Form is "Incompatible With Secondary Licenses", as ;; defined by the Mozilla Public License, v. 2.0. ;; -;; Copyright (c) 2020 UXBOX Labs SL +;; Copyright (c) UXBOX Labs SL (ns app.db (:require @@ -16,8 +16,8 @@ [app.db.sql :as sql] [app.metrics :as mtx] [app.util.json :as json] - [app.util.migrations :as mg] [app.util.logging :as l] + [app.util.migrations :as mg] [app.util.time :as dt] [app.util.transit :as t] [clojure.java.io :as io] diff --git a/backend/src/app/http.clj b/backend/src/app/http.clj index 011cd391f..ed86ccd12 100644 --- a/backend/src/app/http.clj +++ b/backend/src/app/http.clj @@ -17,7 +17,6 @@ [app.metrics :as mtx] [app.util.logging :as l] [clojure.spec.alpha :as s] - [clojure.tools.logging :as log] [integrant.core :as ig] [reitit.ring :as rr] [ring.adapter.jetty9 :as jetty]) diff --git a/backend/src/app/http/awsns.clj b/backend/src/app/http/awsns.clj index 7dccbb08c..77ebf4c6f 100644 --- a/backend/src/app/http/awsns.clj +++ b/backend/src/app/http/awsns.clj @@ -15,7 +15,6 @@ [app.db.sql :as sql] [app.util.http :as http] [app.util.logging :as l] - [clojure.pprint :refer [pprint]] [clojure.spec.alpha :as s] [cuerdas.core :as str] [integrant.core :as ig] diff --git a/backend/src/app/http/middleware.clj b/backend/src/app/http/middleware.clj index c281a4bf0..c117a9a8e 100644 --- a/backend/src/app/http/middleware.clj +++ b/backend/src/app/http/middleware.clj @@ -178,6 +178,6 @@ ::l/logger logger :ip-addr ip-addr :profile-id profile-id - :uri (str (:uri request) (if qstring (str "?" qstring))) + :uri (str (:uri request) (when qstring (str "?" qstring))) :method (name (:request-method request))) (handler request))))) diff --git a/backend/src/app/notifications.clj b/backend/src/app/notifications.clj index 75cb64f46..a045f153b 100644 --- a/backend/src/app/notifications.clj +++ b/backend/src/app/notifications.clj @@ -149,9 +149,7 @@ :out-ch out-ch :sub-ch sub-ch)] - (l/log :level :trace - :action "connect" - :session (:session-id cfg)) + (l/trace :event "connect" :session (:session-id cfg)) ;; Forward all messages from out-ch to the websocket ;; connection @@ -173,18 +171,14 @@ ;; close subscription (a/close! sub-ch)))) - (on-error [_conn e] - (l/log :level :trace - :action "error" - :session (:session-id cfg)) + (on-error [_conn _e] + (l/trace :event "error" :session (:session-id cfg)) (a/close! out-ch) (a/close! rcv-ch)) (on-close [_conn _status _reason] - (l/log :level :trace - :action "close" - :session (:session-id cfg)) + (l/trace :event "close" :session (:session-id cfg)) (a/close! out-ch) (a/close! rcv-ch)) @@ -192,8 +186,7 @@ (on-message [_ws message] (let [message (t/decode-str message)] (when-not (a/offer! rcv-ch message) - (l/log :level :warn - :msg "drop messages"))))] + (l/warn :msg "drop messages"))))] {:on-connect on-connect :on-error on-error diff --git a/backend/src/app/util/logging.clj b/backend/src/app/util/logging.clj index afe03bab7..0f5fc5bb5 100644 --- a/backend/src/app/util/logging.clj +++ b/backend/src/app/util/logging.clj @@ -9,10 +9,8 @@ (ns app.util.logging (:require - [linked.core :as lk] [clojure.pprint :refer [pprint]]) (:import - java.util.Map org.apache.logging.log4j.Level org.apache.logging.log4j.LogManager org.apache.logging.log4j.Logger @@ -65,7 +63,7 @@ ^Object msg))) (defmacro log - [& {:keys [level cause msg ::logger ::async] :as props}] + [& {:keys [level cause ::logger ::async] :as props}] (let [props (dissoc props :level :cause ::logger ::async) logger (or logger (str *ns*)) logger-sym (gensym "log") diff --git a/backend/src/app/util/migrations.clj b/backend/src/app/util/migrations.clj index bc47f5967..aa6bbf43c 100644 --- a/backend/src/app/util/migrations.clj +++ b/backend/src/app/util/migrations.clj @@ -12,7 +12,6 @@ [app.util.logging :as l] [clojure.java.io :as io] [clojure.spec.alpha :as s] - [cuerdas.core :as str] [next.jdbc :as jdbc])) (s/def ::name string?)