`example-config` docstring hk

This commit is contained in:
Peter Taoussanis 2013-11-30 20:01:58 +07:00
parent d75a2db4dd
commit 3dc9d6522b
1 changed files with 21 additions and 12 deletions

View File

@ -91,26 +91,35 @@
(def example-config (def example-config
"APPENDERS "APPENDERS
An appender is a map with keys: An appender is a map with keys:
:doc, :min-level, :enabled?, :async?, :fn, :doc ; (Optional) string.
:rate-limit ; [ncalls-limit window-ms], :min-level ; (Optional) keyword, or nil (no minimum level).
:fmt-output-opts ; Extra opts passed to `fmt-output-fn`. :enabled? ; (Optional).
:async? ; (Optional) dispatch using agent (good for slow appenders).
:rate-limit ; (Optional) [ncalls-limit window-ms].
:fmt-output-opts ; (Optional) extra opts passed to `fmt-output-fn`.
:fn ; (fn [appender-args-map]), with keys described below.
An appender's fn takes a single map with keys: An appender's fn takes a single map with keys:
:level, :throwable :level ; Keyword
:args, ; Raw logging macro args (as given to `info`, etc.). :error? ; Is level an 'error' level?
:message, ; Stringified logging macro args, or nil. :throwable ; java.lang.Throwable
:output ; Output of `fmt-output-fn`, used by built-in appenders :args ; Raw logging macro args (as given to `info`, etc.).
; as final, formatted appender output. :message ; Stringified logging macro args, or nil.
:ap-config ; `shared-appender-config`. :output ; Output of `fmt-output-fn`, used by built-in appenders
:profile-stats ; From `profile` macro. ; as final, formatted appender output.
And also: :instant, :timestamp, :hostname, :ns, :error? :ap-config ; `shared-appender-config`.
:profile-stats ; From `profile` macro.
:instant ; java.util.Date
:timestamp ; String generated from :timestamp-pattern, :timestamp-locale
:hostname ; String
:ns ; String
MIDDLEWARE MIDDLEWARE
Middleware are fns (applied right-to-left) that transform the map Middleware are fns (applied right-to-left) that transform the map
dispatched to appender fns. If any middleware returns nil, no dispatching dispatched to appender fns. If any middleware returns nil, no dispatching
will occur (i.e. the event will be filtered). will occur (i.e. the event will be filtered).
The `example-config` code contains more details. The `example-config` code contains further settings and details.
See also `set-config!`, `merge-config!`, `set-level!`." See also `set-config!`, `merge-config!`, `set-level!`."
{;;; Control log filtering by namespace patterns (e.g. ["my-app.*"]). {;;; Control log filtering by namespace patterns (e.g. ["my-app.*"]).