Giter VIP home page Giter VIP logo

Comments (4)

ptaoussanis avatar ptaoussanis commented on May 22, 2024

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?

from timbre.

jennykwan avatar jennykwan commented on May 22, 2024

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...

from timbre.

ptaoussanis avatar ptaoussanis commented on May 22, 2024

Ideally everything output by the service gets written to the same file

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 $X and that this is what you want, all you'll need to do is adjust the Timbre config to also output to file $X:

(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!

from timbre.

ptaoussanis avatar ptaoussanis commented on May 22, 2024

Am closing this, feel free to reopen if you're still having trouble.

from timbre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.