This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-19
Channels
- # announcements (1)
- # babashka (40)
- # beginners (84)
- # biff (46)
- # calva (37)
- # cherry (2)
- # cider (18)
- # clj-otel (5)
- # clojure (53)
- # clojure-europe (39)
- # clojure-hungary (12)
- # clojure-norway (40)
- # clojure-sweden (2)
- # clojure-uk (2)
- # clojurescript (6)
- # community-development (21)
- # cursive (28)
- # data-science (12)
- # datomic (3)
- # figwheel-main (2)
- # fulcro (12)
- # graalvm (7)
- # gratitude (1)
- # hyperfiddle (23)
- # integrant (9)
- # jobs (2)
- # leiningen (4)
- # lsp (8)
- # malli (3)
- # missionary (1)
- # off-topic (39)
- # polylith (3)
- # portal (33)
- # practicalli (4)
- # re-frame (3)
- # releases (1)
- # sci (53)
- # solo-full-stack (8)
- # sql (5)
- # timbre (9)
Hi! I would like to use different output-fn
s for different deployments. I was thinking of specifying an edn config in the supported environment variable TAOENSSO_TIMBRE_CONFIG_EDN
and referense the different output-fn
s via a qualified symbol.
But the symbols are not resolved. Would that be possible and perhaps desired to add support for that?
Hi there!
Have you considered using your own environment variable to specify your deployment type, then writing some code to check that value and set an appropriate Timbre config and/or appropriate output-fns
?
That’d be much simpler than trying to get Timbre to resolve nested symbols.
Yes that is kind of what I am doing now. The reason I started looking at other approaches was that I had multiple apps using timbre and this would allow me to remove the init code from them and just specify the timbre config to be used.
If I understand correct currently it is not possible to completely configure timbre through a edn file as you need to be able to provide functions. This would be a way to allow that.
> The reason I started looking at other approaches was that I had multiple apps using timbre and this would allow me to remove the init code from them and just specify the timbre config to be used.
Okay gotcha, thanks for explaining 👍
But you would still need to have code in each app to define the various output-fn
s, right?
Would selecting an output fn based on your env-var be much more code?
I’m reluctant to pursue the nested symbol resolution for a few reasons:
1. Implementing this correctly may be non-trivial.
2. Understanding and documenting the behaviour may be non-trivial. For example: do we also resolve symbols for appenders? What about other config options? How do we decide what gets resolved? What happens when a resolve fails?
3. Config-based resolution wouldn’t work for ClojureScript, meaning different config behaviour between Clj and Cljs.
4. Embedding symbols meant for resolution in config can be a little brittle. It’s relatively easy for a var name to change and lose sync with external config.
I’m skeptical that any value-add here would be worth the complexity, especially since there’s already a simple + reliable way of achieving the same result.
Does that seem reasonable?
> But you would still need to have code in each app to define the various output-fn
s, right?
In my particular case there is a common library/ns that define the output-fn
s
But yes it sounds reasonable. Thanks for taking your time to consider the suggestion 👍
You’re welcome, best of luck!