This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-27
Channels
- # adventofcode (1)
- # announcements (5)
- # babashka (11)
- # beginners (41)
- # biff (16)
- # calva (2)
- # clj-together (1)
- # clojure (9)
- # clojure-austin (8)
- # clojure-doc (1)
- # clojure-europe (45)
- # clojurescript (4)
- # clr (14)
- # datomic (13)
- # figwheel (1)
- # fulcro (11)
- # introduce-yourself (2)
- # lsp (31)
- # malli (6)
- # off-topic (3)
- # releases (2)
- # reveal (8)
- # schema (1)
- # shadow-cljs (13)
- # spacemacs (10)
- # timbre (8)
- # transit (3)
- # xtdb (5)
I'm using https://github.com/viesti/timbre-json-appender alongside timbre, with the first line in my -main
as (json-appender/install {:min-level :info})
, any idea why I'd still get the default appender for any threads created (via (Thread. (fn [] ,,,))
after that point? Is there an easy way to fix this?
It seems that I should be able to get my preferred behavior by instead using (Thread. (bound-fn [] ,,,))
, will test and report back
Using bound-fn
did not appear to work 😕
Oh, maybe json serialization is failing? These do seem to mostly be Exception-related messages that look like they're using the default appender
Check out alter-var-root
too, it's the imperative approach (it sets a global context that is visible to the entire process)
bound-fn
should work with Thread.
for typical log lines but weird stuff (that cannot be JSON serialized, like you said) might still bypass the appender, that's to be expected
Yeah, I think it's json serialization issues, I didn't have the exceptions in the position to automatically Throwable->map
FYI if you run Throwable->map you lose the ability to ex-data
ExceptionInfo
s, which might not be what you want
This is just for the logging, the viesti json appender seems to handle it properly as long as the exceptions are the first arg to the logging macros (I was putting them under an unrelated key before)
Using bound-fn
did not appear to work 😕