fzakaria / slf4j-timbre

SLF4J binding for Clojure's Timbre
Eclipse Public License 1.0
94 stars 23 forks source link

mongodb log problem #15

Closed erikseppanen closed 8 years ago

erikseppanen commented 8 years ago

I've recently been trying to get slf4j-timbre to work with mongodb logs, but getting an error that seems to be introduced only when I add slf4j-timbre as a dependency.

I've been closely following the changes made in the last few days, like updating the README to include the three 1.7.14 version dependencies, so I think everything is OK with having the right dependencies.

I'm using a standalone MongoDB as the datasource for the application, and normally (without slf4j-timbre) it it successfully returns a server from the ReadPreferenceServerSelector query (stacktrace attached: no-slf4j-timbre.log).

However, when I add slf4j-timbre as a dependency in project.clj (and that's the only change), it fails on the first DB operation, which I can't explain, but it looks like it may be due to the mongodb logging event being a warning, which timbre-adapter tries to wrap, but fails for some reason.

add-slf4j-timbre.txt no-slf4j-timbre.txt

rufoa commented 8 years ago

java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT at slf4j_timbre.adapter$_warn$inner2062auto____2086.(adapter.clj:45)

My guess is that an older version of Clojure is shadowing a newer version in your project.

Which version of Clojure do you have configured in your project.clj?

Could you also please post the output of lein deps :tree

erikseppanen commented 8 years ago

Thanks for the advice!

I stripped the project down to basically timbre, slf4j-timbre, & mongodb, and found that slf4j-timbre works as expected with mongodb logs. So I don't think it's a slf4j-timbre problem per se, and this issue can be closed.