Logster.Plugs.Logger (Logster v1.0.2) View Source

A plug for logging request information in the format:

method=GET path=/articles/some-article format=html controller=HelloPhoenix.ArticleController action=show params={"id":"some-article"} status=200 duration=0.402 state=set

To use it, just plug it into the desired module.

plug Logster.Plugs.Logger, log: :debug

For Phoenix applications, replace Plug.Logger with Logster.Plugs.Logger in the endpoint.ex file:

# plug Plug.Logger
plug Logster.Plugs.Logger

Options

  • :log - The log level at which this plug should log its request info. Default is :info.
  • :formatter - The formatter module to use, has to implement format/1. Default is Logster.StringFormatter.
  • :renames - Map of fields to rename, for example: %{status: :mystatus}.
  • :excludes - List of fields to exclude from the log, for example: [:params].

Link to this section Summary

Link to this section Functions