I am trying to set up multiple logging streams for riemann. I have decided to use the simple Clojure file write function to set up additional streams. However, the file is written to as soon as riemann is reloaded but results in a null pointer exception when the relevant event is called and the file needs to be written to.
(where (and (or (tagged "source1") (host "shubham"))
(not (= (:installation_id event) "default")))
(smap (fn [event] (prepare-influx-event event {:time-unit :nanoseconds}))
influx
)
(let [wrtr (io/writer "/var/log/riemann/test.txt" :append true)]
(.write wrtr "Listen please1\n")
(.close wrtr))
;;(spit "/var/log/riemann/test.txt" "Listen please2\n" :append true)
)