LogfmtLogger

An Elixir logger backend that outputs logs in logfmt style.

Installation

If available in Hex, the package can be installed by adding logfmt_logger to your list of dependencies in mix.exs:

def deps do
  [
    {:logfmt_logger, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/logfmt_logger.

Usage

To log a message with metadata:

Logger.warn("It's getting smokey in here", house_on_fire: true, firedept_called: false)

which will output:

time=2018-05-01T09:34:58 level=warn msg="It's getting smokey in here" house_on_fire=true firedept_called=false