PlugLoggerJson

Hex pmBuild StatusLicense

A comprehenisve JSON logger Plug.

Dependencies

Elixir & Erlang Support

Installation

If available in Hex, the package can be installed as:

  1. Add plug_logger_json to your list of dependencies in mix.exs:

    def deps do [{:plug_logger_json, "~> 0.5.0"}] end

  2. Ensure plug_logger_json is started before your application:

    def application do [applications: [:plug_logger_json]] end

  3. 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.