PlugLoggerJson

Hex pm Build Status License

A comprehensive JSON logger Plug.

Dependencies

Elixir & Erlang Support

Installation

  1. Add plug_logger_json to your list of dependencies in mix.exs:
def deps do
[{:plug_logger_json, "~> 0.6.0"}]
end
  1. Ensure plug_logger_json is started before your application (Skip if using Elixir 1.4 or greater):
def application do
[applications: [:plug_logger_json]]
end
  1. Replace Plug.Logger with Plug.LoggerJSON, log: Logger.level in your plug pipeline (endpoint.ex for phoenix apps)

or for extra attributes (see extra attributes section)

  1. Replace Plug.Logger with Plug.LoggerJSON, log: Logger.level, extra_attributes_fn: &MyPlug.extra_attributes/1 in your plug pipeline (endpoint.ex for phoenix apps)

Error Logging

Extra Attributes

Log Verbosity

Contributing

Before submitting your pull request, please run:

Please squash your pull request's commits into a single commit with a message and detailed description explaining the commit.