   (:require [containium.systems :refer (Startable Stoppable)]
             [containium.systems.config :refer (Config get-config)]
             [taoensso.timbre :as timbre]
-            [clojure.string :refer (upper-case)])
-  (:import [java.io PrintStream]))
+            [clojure.string :refer (upper-case)]
+            [clojure.java.io :refer (writer)])
+  (:import [java.io PrintStream OutputStream]))
 
 
 ;;; Public API for apps


(defn mk-appender
  [sessions-atom prefix log-writer]
  {:timestamp-pattern "yyyy-MMM-dd HH:mm:ss ZZ"
   :appenders
   {:containium
    {:enabled? true

                            (str "[" (when prefix (str prefix "@")) ns "] " (::msg message))
                            (str (when prefix (str "[" prefix "] ")) message))]
             (when log-writer
               (write-line log-writer (str timestamp "  " (upper-case (name level)) "  " prefixed)))
             (when sessions-atom
               (doseq [log-writer @sessions-atom]
                 (write-line log-writer
                             (str timestamp "  " (upper-case (name level)) "  " prefixed))))))}}})


;; sessions = (atom #{LogWriter})
