File tree 3 files changed +19
-1
lines changed
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 76
76
(defserverfn mk-worker [conf mq-context storm-id supervisor-id port worker-id]
77
77
(log-message " Launching worker for " storm-id " on " supervisor-id " :" port " with id " worker-id
78
78
" and conf " conf)
79
+ (if-not (local-mode? conf)
80
+ (redirect-stdio-to-log4j! ))
79
81
(let [active (atom true )
80
82
storm-active-atom (atom false )
81
83
cluster-state (cluster/mk-distributed-cluster-state conf)
Original file line number Diff line number Diff line change 15
15
16
16
(defmacro log-warn [& args]
17
17
`(log/warn (str ~@args)))
18
+
19
+ (defn log-capture! [& args]
20
+ (apply log/log-capture! args))
21
+
22
+ (defn log-stream [& args]
23
+ (apply log/log-stream args))
Original file line number Diff line number Diff line change 13
13
(:import [org.apache.commons.io FileUtils])
14
14
(:import [org.apache.commons.exec ExecuteException])
15
15
(:import [org.json.simple JSONValue])
16
- (:import [java.util Timer ])
16
+ (:import [clojure.lang RT ])
17
17
(:require [clojure.contrib [str-utils2 :as str]])
18
18
(:require [clojure [set :as set]])
19
19
(:use [clojure walk])
568
568
(cond ~@guards
569
569
true (throw ~error-local)
570
570
)))))
571
+
572
+ (defn redirect-stdio-to-log4j! []
573
+ ; ; set-var-root doesn't work with *out* and *err*, so digging deeper here
574
+ (.set RT/OUT (java.io.OutputStreamWriter.
575
+ (log-stream :info " STDIO" )))
576
+ (.set RT/ERR (PrintWriter.
577
+ (java.io.OutputStreamWriter.
578
+ (log-stream :error " STDIO" ))
579
+ true ))
580
+ (log-capture! " STDIO" ))
You can’t perform that action at this time.
0 commit comments