Using clojure, I was able to successfully configure log4j very simply, using this log4j.properties file and including log4j in my class path.
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%d{MMdd HHmmss SSS} %5p %c [%t] %m\n
log4j.rootLogger=DEBUG, STDOUT
Then after: use'ing clojure.contrib.logging, I can print the instruction with the required formatting, as expected:
(info "About to print this")
(debug "This is debug-level")
My question is how to achieve consistent formatting for logging statements made from logs configured in other libraries. I thought I could find existing registrars using org.apache.log4j.LogManager.getCurrentLoggers () and change PatternLayouts there, but I cannot iterate over this listing in clojure, since I get the following error:
Dont know how to create ISeq from: java.util.Vector$1
I suppose this is possible somehow, and perhaps very simple. How?
Many thanks.