riemann.logging

configure-from-file

(configure-from-file context config-file)

Configure logging from a configuration file

configure-from-opts

(configure-from-opts logger context opts)

Configure logging from opts

encoder

multimethod

get-logger

(get-logger)(get-logger logger)

init

(init)(init opts)

Initialize logging. You will probably call this from the config file. You can call init more than once; its changes are destructive. Options:

  • :console? Determine if logging should happen on the console.
  • :console-layout Specifying console layout.
  • :file The file to log to. If omitted, log to console only.
  • :file-layout Specifying file layout.
  • :files A list of files to log to. If provided, a seq or vector is expected containing maps with a :file and an :file-layout
  • :logsize-rotate If size (in bytes) is specified use size based rotation otherwise use default time based rotation.
  • :rotate-count Specifying the number of rotated files to keep. If omitted, keep last 10 rotated files.

Layout can be :riemann or :json. If layout is omitted, the default layout :riemann will be used.

For example:

    ; Basic console logging
    (init)

    ; Also log to a file
    (init {:file "/var/log/riemann.log"})

    ; With rotation
    (init {:console? false :file "/var/log/riemann.log" :rotate-count 10})

    ; Rotate at a certain size
    (init {:console? false
           :file "/var/log/riemann.log"
           :logsize-rotate 1000000000})

    ; Multiple files in different formats
    (init {:console? false
           :files [{:file "/var/log/riemann.log"},
                   {:file "/var/log/riemann.json.log" :file-layout :json}]
           :logsize-rotate 100
           :rotate-count 5})

nice-syntax-error

(nice-syntax-error e)(nice-syntax-error e file)

Rewrites clojure.lang.LispReader$ReaderException to have error messages that might actually help someone.

set-level

(set-level level)(set-level logger level)

Set the level for the given logger, by string name.

Example:

(set-level Level/INFO) or (set-level “riemann.client”, Level/DEBUG)

suppress

macro

(suppress loggers & body)

Turns off logging for the evaluation of body.