Small veneer on top of logback. Originally based on the logging initialization in riemann. Now diverged quite a bit.
For configuration, a single public function is exposed: start-logging!
which
takes care of configuring logback, later logging is done through
standard facilities, such as clojure.tools.logging.
Two extension mechanism are provided to add support for more appenders and encoders,
see build-appender
and build-encoder
respectively
Small veneer on top of logback. Originally based on the logging initialization in riemann. Now diverged quite a bit. For configuration, a single public function is exposed: `start-logging!` which takes care of configuring logback, later logging is done through standard facilities, such as [clojure.tools.logging](https://github.com/clojure/tools.logging). Two extension mechanism are provided to add support for more appenders and encoders, see `build-appender` and `build-encoder` respectively
Called by walking through each key/val pair in the main configuration
map. This allows for early transformation of quick access keys such as:
:console
, :file
, and :files
Called by walking through each key/val pair in the main configuration map. This allows for early transformation of quick access keys such as: `:console`, `:file`, and `:files`
Given a prepared configuration map, associate a prepared appender
to the :appender
key.
Given a prepared configuration map, associate a prepared appender to the `:appender` key.
Given a prepared configuration map, associate a prepared encoder
to the :encoder
key.
Given a prepared configuration map, associate a prepared encoder to the `:encoder` key.
Given a configuration map, build a RollingPolicy instance.
Given a configuration map, build a RollingPolicy instance.
Given a configuration map, build a TriggeringPolicy instance.
Given a configuration map, build a TriggeringPolicy instance.
A simple default logging configuration
A simple default logging configuration
Default encoder and pattern configuration
Default encoder and pattern configuration
Default pattern for PatternLayoutEncoder
Default pattern for PatternLayoutEncoder
Logging level names to logback level association
Logging level names to logback level association
Start an appender according to appender type
Start an appender according to appender type
(start-logging!)
(start-logging! raw-config)
Initialize logback logging from a map.
The map accepts the following keys as keywords
:level
: Default level at which to log.:pattern
: The pattern to use for logging text messages:console
: Append messages to the console using a simple pattern
layout. If value is a boolean, treat it as such and use a default
encoder. If value is a string, treat it as a pattern and use
a pattern encoder. If value is a map, expect encoder configuration
in the map.:file
: A file to log to. May either be a string, the log file, or
a map which accepts optional encoder configuration.:files
: A list of either strings or maps. strings will create
text files, maps are expected to contain a :path
key as well
as an optional :json
which when present and true will switch
the layout to a JSONEventLayout for the logger.:overrides
: A map of namespace or class-name to log level,
this will supersede the global level.:external
: Do not proceed with configuration, this
is useful when logging configuration is provided
in a different manner (by supplying your own logback config file
for instance).When called with no arguments, assume an empty map
example:
{:console true
:level "info"
:files ["/var/log/app.log"
{:file "/var/log/app-json.log"
:encoder json}]
:overrides {"some.namespace" "debug"}}
Initialize logback logging from a map. The map accepts the following keys as keywords - `:level`: Default level at which to log. - `:pattern`: The pattern to use for logging text messages - `:console`: Append messages to the console using a simple pattern layout. If value is a boolean, treat it as such and use a default encoder. If value is a string, treat it as a pattern and use a pattern encoder. If value is a map, expect encoder configuration in the map. - `:file`: A file to log to. May either be a string, the log file, or a map which accepts optional encoder configuration. - `:files`: A list of either strings or maps. strings will create text files, maps are expected to contain a `:path` key as well as an optional `:json` which when present and true will switch the layout to a JSONEventLayout for the logger. - `:overrides`: A map of namespace or class-name to log level, this will supersede the global level. - `:external`: Do not proceed with configuration, this is useful when logging configuration is provided in a different manner (by supplying your own logback config file for instance). When called with no arguments, assume an empty map example: ```clojure {:console true :level "info" :files ["/var/log/app.log" {:file "/var/log/app-json.log" :encoder json}] :overrides {"some.namespace" "debug"}} ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close