Skip to content

Commit

Permalink
don't try to emit clojure stdout/err for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Marz committed Jan 5, 2012
1 parent 130c34e commit a3094ef
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/clj/backtype/storm/util.clj
Expand Up @@ -571,11 +571,15 @@
)))))

(defn redirect-stdio-to-log4j! []
;; set-var-root doesn't work with *out* and *err*, so digging deeper here
(.set RT/OUT (java.io.OutputStreamWriter.
(log-stream :info "STDIO")))
(.set RT/ERR (PrintWriter.
(java.io.OutputStreamWriter.
(log-stream :error "STDIO"))
true))
;; set-var-root doesn't work with *out* and *err*, so digging much deeper here
;; Unfortunately, this code seems to work at the REPL but not when spawned as worker processes
;; it might have something to do with being a child process
;; (set! (. (.getThreadBinding RT/OUT) val)
;; (java.io.OutputStreamWriter.
;; (log-stream :info "STDIO")))
;; (set! (. (.getThreadBinding RT/ERR) val)
;; (PrintWriter.
;; (java.io.OutputStreamWriter.
;; (log-stream :error "STDIO"))
;; true))
(log-capture! "STDIO"))

0 comments on commit a3094ef

Please sign in to comment.