Managing log4j.properties with lein
Asked Answered
H

2

11

I'm trying to figure out how I can manage my log4j.properties file with leiningen. I'd like to be able to automatically include the file in the jars that lein creates as well as have the properties file be accessible to "lein swank" (and lein repl).

Right now I have the file in my project "root", but I get this error when I using logging from swank

[null] log4j:WARN No appenders could be found for logger (com.dev).
[null] log4j:WARN Please initialize the log4j system properly.

Thanks!

NOTE: I got my log4j.properties file from the blog post at http://www.paullegato.com/blog/log4j-clojure/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+clojure+(Planet+Clojure0 I'd be content (actually thrilled) configuring my logging output format from within Clojure, but I haven't found a way to do it yet.

Hight answered 1/6, 2010 at 22:2 Comment(0)
T
17

You should put the log4j.properties file in the resources(top level folder - where project.clj, src, test, lib, classes are) folder of your lein project. That way it will be made available on the classpath and packaged with the project if you run lein jar.

Tentage answered 1/6, 2010 at 22:8 Comment(0)
V
2

Just to keep this current...

You should look at clj-logging-config. It allows you to configure your logger from Clojure.

Vaasta answered 16/5, 2013 at 17:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.