ExJsonLogger

Module Version Hex Docs Total Download License Last Updated

A drop-in replacement for :console's formatter. ExJsonLogger takes standard Logger calls and JSON encodes them.

Ecto and Plug loggers are also included.

Installation

The package can be installed by adding :ex_json_logger to your list of dependencies in mix.exs:

def deps do
[
{:ex_json_logger, "~> 1.3.0"}
]
end
config :logger, :console,
format: {ExJsonLogger, :format},
metadata: [
:action,
:controller,
:duration,
:format,
:method,
:path,
:request_id,
:status
]

For additional configuration and metadata option refer to moduledocs

Documentation

Documentation is generated with ExDoc and available online at https://hexdocs.pm/ex_json_logger

Running the tests

Tests include:

Running the benchmarks

A basic benchee benchmarking script is available for testing performance improvements:

mix run bench/format.exs

Contributing

Copyright (c) 2017 RentPath

This library licensed under the MIT license.