Closed publicimageltd closed 8 months ago
Hi there-
It'd be helpful to first understand a bit better what you're ultimately trying to achieve. What's your motivation for wanting to configure an appender via an .edn
file?
Separating basic configuration logic from the code, that's all. It's for a server. I can, of course, set up the configuration when starting the system. But I thought it could be possible to configure it separately (without rolling my own configuration format).
So the challenge here is that edn is intended to convey values, so isn't generally well suited to things like functions (appenders) or function calls (appender constructors).
I'm not sure what platform you're on or what you've already tried exactly, but your simplest options would include:
taoensso.timbre.config.edn
, etc.)..edn
, your edn just consists of a single qualified symbol that resolves to the appropriate config var. This is described in the *config* docstring
.My 2c- unless you have a good specific reason to create/modify appenders environmentally, I'd normally vote for 1 or 3 above since they're the simplest and should cover most cases.
Cheers :-)
Thanks, that's a useful oversight and confirms my impression that I just can't do it directly in the .edn. I thought there might be some internal mechanism which leverages tagged elements, or automatically parses names so that they will be rebound as function names. Anyways, I see that it would be too complicated for some simple stuff given the alternatives you outlined. Keep on doing the great work!
You're very welcome, thanks for the kind words. Best of luck!
I want to use the
spit-appender
. On the repl, I can log to a file like this:Works fine. But I can't manage to translate that to an entry in the corresponding
.edn
file, which can be also used to set the configuration map. I tried all kind of things, but fail. The file is read, but no matter how I format the reference to the appender, it is just silently ignored.So what's the syntax for adding a spit-appender in the configuration file, and not runtime?