-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use set-config! to output to a file #161
Comments
Hi Chris, Usage of the spit (file) appender is documented in the README at https://github.com/ptaoussanis/timbre#file-appender Hope that helps, cheers! |
Hi Peter, |
Sorry Chris, not sure I follow what needs working out? The README gives an example that you should be able to just copy+paste, no? Or do you specifically want to use the |
True - it was copy/paste: it works. The thing is to me 'appenders' seemed On 13 April 2016 at 15:19, Peter Taoussanis [email protected]
|
Great, thanks for the confirmation.
Understood, no problem. Fwiw, there's no magic going on underneath. Timbre's config's just one big map as in https://github.com/ptaoussanis/timbre#configuration. You can modify the map using Clojure's standard utils like Cheers :-) |
Something I just noticed is that the messages are now going to the file and to the console, whereas in the legacy example I'm pretty sure the output was going to just the file. So next part of the question is how to turn output to console/REPL off. |
The stdout appender is located at (timbre/merge-config!
{:appenders
{:println nil ; Remove println appender
:spit (appenders/spit-appender {:fname "/path/my-file.log"})}}) Will do the trick |
That doesn't work for me. |
You might need to provide some more details than "that doesn't work". Unfortunately going to need to sign off on this issue, have my hands a bit full atm. Would encourage you to check out the docs, otherwise someone else on here should hopefully be able to assist. Best of luck, cheers! :-) |
Adding the mapentry |
Thanks for confirming andreasthoelke. |
A few people don't know how to log to a file. Here's my SO question:
http://stackoverflow.com/questions/36588781/timbre-set-config-has-changed-arity-thus-dont-know-how-to-use-it-to-output-s
Here's another identical one (so mine might not last):
http://stackoverflow.com/questions/35639153/clojure-timbre-4-0-set-config
The text was updated successfully, but these errors were encountered: