Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using multiple loggers in the same namespace with clojure.tools.logging

I'm using clojure.tools.logging, which is using the slf4j factory to instantiate a Logback logger.

What I'd like to do is be able to is have my DAO namespaces log normal messages to the application log, but log all SQL queries to a query log.

Looking at the clojure.tools.logging code, this doesn't really look possible, but I'm hoping that someone can prove me wrong. :)

If clojure.tools.logging can't do this, can anyone suggest another logging facility that can accomplish what I want? Or is it possible to do the routing in Logback's config files?

like image 836
Josh Glover Avatar asked May 08 '26 00:05

Josh Glover


1 Answers

You should be able to specify this, using the last two forms of the log macro. I haven't tried this, only checked the code.

[EDIT]

Here is a sample from the test harness:

(log "other.ns" :debug e "foo")
like image 184
ivant Avatar answered May 10 '26 19:05

ivant



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!