newbie question: where are my log messages going to?

7 views
Skip to first unread message

Wei Hsu

unread,
Aug 27, 2010, 10:58:03 PM8/27/10
to Clojure
Hello,

I'm using the clojure.contrib.logging library (logging/spy seems very
useful!) but I don't know which file it's writing to. Can you please
advise?

Thanks,
Wei

ataggart

unread,
Aug 28, 2010, 3:33:20 PM8/28/10
to Clojure
c.c.logging just delegates to the underlying logging implementation.
If you haven't included a separate logging library on your classpath
(e.g., log4j) then it will default to using java.util.logging. Note
that by default the j.u.logging will output to stdout, and has a
default threshold of INFO. Since the spy macro outputs at debug, you
won't see it unless you change your configuration.

I'd recommend using log4j in preference to the default
java.util.logging. The following is a very basic configuration for
log4j; place it in a file called \"log4j.properties\" and place that
file (and the log4j JAR) on the classpath:

log4j.rootLogger=WARN, A1
log4j.logger.user=DEBUG
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d %-5p %c: %m%n

The above will print messages to the console for :debug or higher if
one is in the 'user namespace, and :warn or higher in all other
namespaces.
Reply all
Reply to author
Forward
0 new messages