fzakaria / slf4j-timbre

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

Blacklisting Log4J namespaces does not work #18

Closed arichiardi closed 8 years ago

arichiardi commented 8 years ago

Hello @fzakaria, I added all the deps you suggest to the my project but when I specify (either at app bootstrap or at runtime):

{:level :debug
             :ns-blacklist ["com.zaxxer.hikari.*"]}

I can still see the DEBUG logs for that namespace (which is recurring, so very annoying I would say :smile:).

If this issue is not strictly related to slf4j-timbre please let me know and I will close it immediately ok? Thank you!

rufoa commented 8 years ago

Thanks for the report, I'll look into this

arichiardi commented 8 years ago

I was also reading this and it might be somehow related: https://github.com/ptaoussanis/timbre/issues/138

rufoa commented 8 years ago

I'm currently unable to reproduce this issue.

Here's my minimal working test case I used: https://github.com/rufoa/slf4j-timbre-testcase Run it with lein run

arichiardi commented 8 years ago

Uhm it looks like it is working indeed, maybe it is because I was trying to mute a class from a dependency? com.zaxxer.hikari.*

rufoa commented 8 years ago

I don't think that would make a difference.

HikariCP seems to use slf4j directly rather than log4j. Do you definitely need log4j-over-slf4j in your project or could you try reproducing the issue without adding this dependency?

rufoa commented 8 years ago

to clarify, you only need to use log4j-over-slf4j if your dependencies normally try to output to log4j - similarly with jul-to-slf4j (if your deps use java.util.logging) and jcl-over-slf4j (if your deps use jakarta commons logging). Sorry if this wasn't clear in the readme

arichiardi commented 8 years ago

Thanks for pointing this out, I usually put all of them as I don't know which one is going to be working with which, but I will try again, I also had some other problem with Timbre and decided to put it on the side for now. But in one project it is still well alive and I will report back, I guess we can close this one for now...

leourbina commented 6 years ago

@arichiardi I had this exact same issue (working on a luminus app + timbre).

The root cause was forgetting to remove [ch.qos.logback/logback-classic "1.1.7"] from my project.clj. This was pulling an old version of slf4j-api which causes things to stop working.

I convinced myself that this wasn't an issue with slf4j-timbre by creating this toy project to test it https://github.com/leourbina/timbre-hikari-demo.

In your case it may be another library that's pulling an old dep. I recommend you run

$ lein pom
$ mvn -Dverbose dependency:tree

This should show all the deps that are being pulled in. Hopefully that helps.

arichiardi commented 6 years ago

Thanks a lot for the suggestion and thanks for putting it here for me and others to see it :+1:

rufoa commented 6 years ago

Thanks for the feedback @leourbina! Outdated [transitive] dependencies are a common problem people experience with this project, so hopefully your advice helps people out in future.