Fork me on GitHub
#clojure
<
2019-07-13
>
pinkfrog03:07:49

what logging tool do you use?

pinkfrog03:07:48

how can i know exactly which logging impl is used by c.t.logging?

pinkfrog04:07:08

basically, i want to set the log level

jumar05:07:52

if you use tools.logging you should know which logging implementation you're using and configured (e.g. via log4j.properties when using log4j)

pinkfrog05:07:18

@jumar that's what stumbles me.

pinkfrog05:07:32

i want to know what underlying logging impl. c.t.l is using

andy.fingerhut06:07:31

Does it make sense that one of the purposes of c.t.l is to allow one of multiple underlying logging implementations to be used, as stated early in its README? If yes, then as you have asked your question, the answer seems to be "the underlying logging implementation that a particular person chose to configure it with in their application".

andy.fingerhut06:07:14

The first two sentences of c.t.l's README: "Logging macros which delegate to a specific logging implementation. At runtime a specific implementation is selected from, in order, slf4j, Apache commons-logging, log4j2, log4j, and finally java.util.logging."

andy.fingerhut06:07:09

Is your question: "After I use c.t.l., how can I at run-time determine which underlying impl. c.t.l. selected?"

pinkfrog03:07:52

yes. that's my question.

potetm11:07:12

@i I would suggest adding the following deps to your project:

org.clojure/tools.logging {:mvn/version "0.4.1"}
        ch.qos.logback/logback-classic {:mvn/version "1.2.3"}
        org.slf4j/slf4j-api {:mvn/version "1.7.26"}

potetm11:07:21

remove all other logging deps

potetm11:07:01

optionally add:

org.slf4j/log4j-over-slf4j {:mvn/version "1.7.26"}
If you find any transient dependencies on log4j in your project.

potetm11:07:35

If you do that, you’ll know for sure that it’s using slf4j 🙂

Ilya18:07:02

I have a project.clj with a :repl-options {:init (load-file "some_file.clj")} in it and when I run lein repl in the project, I get java.lang.RuntimeException: Unable to resolve symbol: do in this context. I’ve tried with some_file.clj itself being empty, so it’s not some code in the file and lein repl only works if I comment out this :repl-options. If it makes a difference I have Leiningen 2.8.1 on Java 1.8.0_192 and the project is on Clojure 1.9.0. What am I doing wrong?

andy.fingerhut18:07:54

I just tried that with a brand new lein project, and was able to successfully run code from some_file.clj with just a sample (println "Got here") in it, and nothing else, both with Leiningen 2.8.1 and 2.9.1.

andy.fingerhut18:07:23

Try that on your system, perhaps, to see if it works with a bare-bones Leininge project?

andy.fingerhut18:07:26

If that doesn't work, then I would suggest checking your $HOME/.lein/profiles.clj file, perhaps renaming it temporarily in case anything in there is causing troubles.

Ilya18:07:50

Thank you! It was indeed the profiles.clj. Hadn’t been in there in a while!

andy.fingerhut18:07:04

Yeah, it is easy to forget about, and has effects cross-projects.

Ilya18:07:57

Simple enough, phew, well thanks!

Ilya20:07:44

This was actually for http://clojuredocs.org. Took at stab at updating it to Clojure 1.10.1 and noticed you had actually added that issue 🙂

andy.fingerhut04:07:46

Thanks for working on it!