This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-27
Channels
- # admin-announcements (1)
- # announcements (1)
- # babashka (16)
- # beginners (222)
- # bristol-clojurians (6)
- # calva (13)
- # cestmeetup (5)
- # cider (19)
- # cljs-dev (2)
- # cljsrn (4)
- # clojure (65)
- # clojure-europe (31)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-uk (33)
- # clojurescript (64)
- # community-development (5)
- # core-async (18)
- # cursive (15)
- # datomic (6)
- # devcards (1)
- # emacs (18)
- # figwheel-main (102)
- # fulcro (51)
- # graalvm (2)
- # helix (8)
- # instaparse (33)
- # jobs (8)
- # jobs-discuss (3)
- # leiningen (42)
- # off-topic (88)
- # pedestal (15)
- # re-frame (18)
- # reagent (26)
- # reitit (15)
- # rum (3)
- # shadow-cljs (119)
- # spacemacs (9)
- # sql (2)
- # tools-deps (7)
Was it intentional in io.pedestal.logging 0.5.8 to not reference the override-logger at this line: https://github.com/pedestal/pedestal/blob/master/log/src/io/pedestal/log.clj#L277
Essentially, for my code that bridges from io.pedestal.log to our internal logging code, changing io.pedestal.log/override-logger has no effect, as that only works for the pretty much unused io.pedestal.log/log function, and not for log-expr which is where logging really takes place.
And that puts me pack at square 1, because io.pedestal.log/debug
has already been compiled from the result of log-expr before my code has a chance to either set override-logger or set the JVM system property.
(macroexpand-all '(pl/debug :from :pedestal :a 1 :b 2))
=>
(let*
[logger2682 (. org.slf4j.LoggerFactory getLogger "user")]
(if
(io.pedestal.log/-level-enabled? logger2682 :debug)
(do
(let*
[string2683
(let*
[]
(clojure.core/push-thread-bindings (clojure.core/hash-map (var clojure.core/*print-length*) 80))
(try
(#object[clojure.core$pr_str 0x16f7b4af "clojure.core$pr_str@16f7b4af"] {:from :pedestal, :a 1, :b 2, :line 1})
(finally (clojure.core/pop-thread-bindings))))]
(io.pedestal.log/-debug logger2682 string2683)))))
Hi @hlship, the only change in 0.5.8 re: logging was to the log
fn. The particular code you linked hasn’t changed in years. What version of Pedestal are you migrating from?
I recall running into an issue regarding logger overriding and thought I created a GitHub issue for it but that does not seem to be the case.
There was the issue that overrideLogger
couldn't be used, because it was not treated as a function, that was fixed in 0.5.8.
(def logger (memoize logger*))
;; This actually doesn't accomplish anything in Pedestal 0.5.8
(alter-var-root #'io.pedestal.log/override-logger (fn [_] logger))
(System/setProperty "io.pedestal.log.overrideLogger" "com.walmartlabs.log.pedestal/logger")