{"action":"closed","issue":{"url":"https://api.github.com/repos/malcolmsparks/clj-logging-config/issues/27","labels_url":"https://api.github.com/repos/malcolmsparks/clj-logging-config/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/malcolmsparks/clj-logging-config/issues/27/comments","events_url":"https://api.github.com/repos/malcolmsparks/clj-logging-config/issues/27/events","html_url":"https://github.com/malcolmsparks/clj-logging-config/issues/27","id":41786322,"number":27,"title":"Is there a way around log4j.properties at initialization?","user":{"login":"venantius","id":1824859,"avatar_url":"https://avatars.githubusercontent.com/u/1824859?v=3","gravatar_id":"","url":"https://api.github.com/users/venantius","html_url":"https://github.com/venantius","followers_url":"https://api.github.com/users/venantius/followers","following_url":"https://api.github.com/users/venantius/following{/other_user}","gists_url":"https://api.github.com/users/venantius/gists{/gist_id}","starred_url":"https://api.github.com/users/venantius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/venantius/subscriptions","organizations_url":"https://api.github.com/users/venantius/orgs","repos_url":"https://api.github.com/users/venantius/repos","events_url":"https://api.github.com/users/venantius/events{/privacy}","received_events_url":"https://api.github.com/users/venantius/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-09-03T06:44:26Z","updated_at":"2015-02-18T05:49:24Z","closed_at":"2015-02-18T05:49:24Z","body":"I'm noticing that a lot of libraries my app depends on tend to do some sort of log initialization that doesn't play nicely with clj-logging-config at import time.\r\n\r\nFor instance: right now, I've got an app with a method that configures logging as follows:\r\n\r\n```clojure\r\n(defn set-logging-defaults\r\n  \"Set the logging level for the application root\"\r\n  []\r\n  (set-loggers! :root {:level :info\r\n                       :out :console\r\n                       :pattern \"[%p] %d{MM-dd-yyyy HH:mm:ss} | %m%n\"}))\r\n```\r\n\r\nThis method then gets called in a configuration method before the server starts up, e.g.:\r\n```clojure\r\n(defn -main []\r\n  (init/configure)\r\n  (server/run-server #'app {:port (Integer. (or (System/getenv \"PORT\") \"8080\"))\r\n                            :join? false}))\r\n```\r\n\r\nHowever, I have korma.db on the import path for my app's `core` namespace. The import happens before the logging configuration is executed, and I end up with the following when I launch my app (removing the `korma.db` import immediately removes this WARN):\r\n```\r\nlog4j:WARN No appenders could be found for logger (com.mchange.v2.log.MLog).\r\nlog4j:WARN Please initialize the log4j system properly.\r\nlog4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.\r\n```\r\nIs there a way around this that I haven't figured out that doesn't rely on either creating a log4j.properties file or executing `(set-logging-defaults)` at import time? In general, what's the recommended practice here? "}}