View Source CozyLogger.JsonFormatter (cozy_logger v0.1.0)

A JSON formatter for Elixir built-in console backend.

usage

Usage

# use Elixir built-in console backend, and configure other necessary options
config :logger,
  backends: [:console],
  truncate: :infinity,
  utc_log: true

# use this formatter
config :logger, :console,
  format: {CozyLogger.JsonFormatter, :format},
  metadata: :all,
  colors: [enabled: false]

Link to this section Summary

Link to this section Functions

Link to this function

format(level, message, timestamp, metadata)

View Source
@spec format(atom(), term(), Logger.Formatter.time(), keyword()) :: IO.chardata()