Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress clojure logging in Eclipse?

I'm working with a 3rd party library implemented in Clojure which logs messages using clojure.tools.logging.

I want to suppress these messages in Eclipse and have tried the following suggestion to no avail.

Any (hacky) solutions greatly appreciated.

like image 906
Jack L. Avatar asked Feb 20 '26 22:02

Jack L.


1 Answers

It sounds like your clojure.tools.logging is using a different underlying logging implementation than the rest of your application?

For example if your application is using java.util.logging, but you have a stray log4j library in your classpath, then clojure.tools.logging would detect log4j and would therefore not react to the logging config changes you were making.

The logic for detecting the underlying logging implementation is here:

https://github.com/clojure/tools.logging/blob/master/src/main/clojure/clojure/tools/logging/impl.clj

Specifically:

(defn find-factory
  "Returns the first non-nil value from slf4j-factory, cl-factory,
   log4j-factory, and jul-factory."
  []
  (or (slf4j-factory)
      (cl-factory)
      (log4j-factory)
      (jul-factory)
      (throw ; this should never happen in 1.5+
        (RuntimeException.
          "Valid logging implementation could not be found."))))

It would be helpful to run mvn dependency:tree or lein deps :tree to see what logging dependencies are on your classpath.

like image 179
toolkit Avatar answered Feb 23 '26 11:02

toolkit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!