It outputs the events into a file in JSON format, one entry per line
In order to use the library add the dependency to your project.clj
;; Leiningen project
[com.brunobonacci/mulog-adv-file "x.x.x"]
;; deps.edn format
{:deps { com.brunobonacci/mulog-adv-file {:mvn/version "x.x.x"}}}
The events must be serializeable in JSON format (see How to JSON encode custom Java classes for more info.)
The available configuration options:
{:type :file-json
;; the destination for the serialized JSON events.
;; Can be a path as a String or java.io.File, in which case
;; parent directories will be created before writing,
;; or anything that is coercible to a java.io.Writer.
:filename "/path/to/file.json"
;; a function to apply to the sequence of events before publishing.
;; This transformation function can be used to filter, tranform,
;; anonymise events before they are published to a external system.
;; by defatult there is no transformation. (since v0.1.8)
:transform identity
}
How to use it:
(μ/start-publisher! {:type :file-json :filename "/path/to/file.json"})
Can you improve this documentation? These fine people already did:
Emlyn Corrin & Bruno BonacciEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close