                             :hystrix-httpd        (run-hystrix-jetty (merge configuration {:join? false
                                                                                            :port  7979}))
                             :handler              handler
-                            :audit-log-flush-pool (schedule-audit-log-flusher audit-logs-bucket audit-logs configuration)}))))))
+                            :audit-log-flush-pool (schedule-audit-log-flusher! audit-logs-bucket audit-logs configuration)}))))))
 
 (defn stop-component
   "Stops the http component."

      (when-not (:no-listen? (:configuration component))
        (.stop (:httpd component))
        (.stop (:hystrix-httpd component))
        (stop-audit-log-flusher (:audit-logs-bucket component) (:audit-logs component) (:audit-log-flush-pool component)))
      (merge component {:httpd                nil
                        :hystrix-httpd        nil
                        :handler              nil

      (log/info "Not logging modifying requests.")
      next-handler)))

(def default-audit-flush-millis (* 5 60 1000))

(def audit-logs-file-formatter
  "yyyy/MM/dd/{app-id}/{app-version}/{instance-id}/modifying-requests-hh-mm-ss.log
  e.g. 2015/06/15/kio/b2/i123456/modifying-requests-08-31-52.log"
  (let [app-id (or (System/getenv "APPLICATION_ID") "unknown-app")
        app-version (or (System/getenv "APPLICATION_VERSION") "unknown-version")
        instance-id (or (System/getenv "INSTANCE_ID") "unknown-instance")
        format-string (format "yyyy/MM/dd/'%s/%s/%s/modifying-requests'-HH-mm-ss'.log'" app-id app-version instance-id)]
    (tf/formatter format-string t/utc)))

(defn store-audit-logs!
  "Stores the audit logs in an S3 bucket."
