-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Passing in timbre as tools.logging.impl/LoggerFactory for dependencies using tools.logging #10
Comments
Hi Alyssa, Redirecting tools.logging to Timbre might be difficult, though I haven't tried. Would it not be possible in your case to just leave the tools.logging dependency as is and add Timbre as a second dependency? There's no problem with having both. Most of my projects pull in some kind of Java logger through a transitive dependency, I just never use any of them. Does that make sense? Is that acceptable in your case? |
Yeah that's fine. I guess I don't know the arcane magical spell to get tools.logging and Timbre to both write to the same log file. Ideally everything output by the service gets written to the same file, with messages being written in the same order (in the same process of course). I assume opening a Log4J stream and using that for tools.logging is the best bet. I'll look into how to pass that same stream handler to Timbre... As I write this, it seems less and less likely... |
That shouldn't be a problem. Do you know how your tools.logging is configured? Is it currently outputting to a file? What file? Is it outputting by appending directly to a file, or is it outputting to stdout and stdout is being piped to a file? Assuming tools.logging is configured to output directly to file (timbre/set-config! [:shared-appender-config :spit-filename] $X)
(timbre/set-config! [:appenders :spit :enabled?] true) And that should give you the behavior you want: both Timbre and tools.logging will output (append) to the same file. Hope that helps! |
Am closing this, feel free to reopen if you're still having trouble. |
I like Timbre. I want to use it in my current project. However, it uses tools.nrepl as a dependency. tools.nrepl uses tools.logging. I want it to use timbre. Is it possible to set tools.logging up to redirect to timbre?
The text was updated successfully, but these errors were encountered: