I am trying to use https://github.com/ptaoussanis/timbre to log to a file rather than the console. Here is some documentation I've found on how to do that:
; The default setup is simple console logging. We with to turn off console logging and
; turn on file logging to our chosen filename.
(timbre/set-config! [:appenders :standard-out :enabled?] false)
(timbre/set-config! [:appenders :spit :enabled?] true)
(timbre/set-config! [:shared-appender-config :spit-filename] log-file-name)
(timbre/set-config! [:shared-appender-config :spit-filename] log-file-name)
This works for a previous version of sente, but not for version [com.taoensso/timbre "4.3.1"]. (For unrelated reasons I need to use the latest). The issue with the above code is that set-config! now takes one argument - a hash-map. And I can't find any documentation that would help me with translating the above 'two params' code to the new 'one param' code.
I know there's a very similar question out there. This question has actual code in it so is more specific. I raised an issue as well. The code above basically comes straight from here.
To log to a file rather than the console in timbre v4.0.0 (2015 June 10) you can do the following:
Note that in timbre v4.3.1 the following does not remove nor disable the println (console) appender:
The related issue can be found here https://github.com/ptaoussanis/timbre/issues/163
Addition: As Timbre allows to modify it's config map
timbre/*config*simply by using the standard clojure API, you may also useBased on this you can additionally define a simple helper:
and then be consistent with the timbre v3.4.0 set-config! syntax you have quoted in your question:
Imho this eases the config transition between timbre v3 and v4 and makes the path to the params more readable then the equivalent