cartus.cambium

A cartus.core/Logger implementation that delegates all logged events to cambium.

initialise

(initialise)(initialise {:keys [decoder transformer], :or {decoder cambium.codec/destringify-val}})

Initialises cambium and logback.

Specifically:

  • configures the decoder for the chosen codec onto the cambium layout class;
  • configures the transformer, when provided, onto the cambium layout class; and
  • configures java.util.logging to log through SLF4J.

When no argument is provided, no transformer is configured.

See the cambium documentation for further details.

logger

(logger)

Constructs a cambium logger logging all events through cambium.

Whilst cartus.cambium includes the core cambium and logback dependencies, in order to use this logger, additional cambium dependencies must be included. These dependencies control the codec used for encoding and decoding structured data and the backend used to output the event. Additionally, logback appenders must be configured to use cambium.

See the cambium documentation for further details.

Once a codec and backend have been chosen and configured, cambium must be initialised before any events are logged. This can be achieved with initialise.

Since SLF4J requires a message on all log events, the resulting logger will use the event type as the message by default, with the type also appearing on the logged event under the "type" key. An explicitly passed message overrides this behaviour.