Logbook.Backends.Logfmt (logbook v4.0.0)

View Source

Log format file based backend.

This backend is opinionated for optimal support of Logbook tagged logging, so a tags entry is always added even if no tags (ie called by plain Logger) are given.

This backend cannot be configured, all metadata is always logged, along with additional fields.

Here is an example of how to configure the Logfmt backend in a config/config.exs file:

# Configures Elixir's Logger
config :logger,
  backends: [
    :console,
    {Logbook.Backends.Logfmt, :log_fmt_log}
  ]

# Log formar file log
config :logger, :log_fmt_log, path: "/var/log/somefile.log"