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 implementformat/1
. Default isLogster.StringFormatter
.:renames
- Map of fields to rename, for example:%{status: :mystatus}
.:excludes
- List of fields to exclude from the log, for example:[:params]
.