Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Attempt to log with log4j.

  • Loading branch information...
commit 2192ccfdc7f8fefa9e27ef99ee0bf7bfef09d453 1 parent 23415dc
@technomancy authored
Showing with 8 additions and 3 deletions.
  1. +2 −1  project.clj
  2. +6 −2 src/die/roboter.clj
View
3  project.clj
@@ -5,5 +5,6 @@
[commons-codec "1.5"]
[com.mefesto/wabbitmq "0.2.1"
:exclusions [org.clojure/clojure-contrib]]
- [org.clojure/tools.logging "0.2.0"]]
+ [org.clojure/tools.logging "0.2.0"]
+ [log4j "1.2.9"]]
:checksum-deps true)
View
8 src/die/roboter.clj
@@ -11,7 +11,8 @@
(java.lang.management ManagementFactory)
(java.io FilterInputStream ObjectInputStream ObjectOutputStream
ByteArrayInputStream ByteArrayOutputStream)
- (org.apache.commons.codec.binary Base64)))
+ (org.apache.commons.codec.binary Base64)
+ (org.apache.log4j Level LogManager)))
(def ^{:doc "Namespace in which robots work." :private true} context
(binding [*ns* (create-ns 'die.roboter.context)] (refer-clojure) *ns*))
@@ -193,9 +194,12 @@
(defn -main [& {:as opts}]
(let [opts (into {:workers (or (System/getenv "WORKER_COUNT") 4)
- :url (System/getenv "RABBITMQ_URL")}
+ :url (System/getenv "RABBITMQ_URL")
+ :log-level (or (System/getenv "LOG_LEVEL") "info")}
(walk/keywordize-keys opts))]
(println "Starting" (:workers opts) "workers.")
+ (.setLevel (LogManager/getLogger "die.roboter")
+ (Level/toLevel (.toUpperCase (:log-level opts))))
(when (:require opts)
(require (symbol (:require opts))))
(dotimes [n (Integer. (:workers opts))] (add-worker opts))
Please sign in to comment.
Something went wrong with that request. Please try again.