ex_json_logger v0.1.2 ExJsonLogger.Plug.Logger
A plug for logging request information through metadata.
Logger Metadata avaliable:
- method - request method
- path - request path
- status - request status (integer)
- duration - time in milliseconds from connection to response (float)
- format - (phoenix specific)
- controller - (phoenix specific)
- action - (phoenix specific)
Metadata is filtered by default so keys will need to be whitelisted.
Usage
To use with a Phoenix application, replace plug Plug.Logger
in the projects endpoint.ex file with ExJsonLogger.Plug.Logger
:
# plug Plug.Logger
plug ExJsonLogger.Plug.Logger
Options
:log
- The log level at which this plug should log its request info. Default is:info
.
Summary
Functions
Callback implementation for Plug.call/2
.
Callback implementation for Plug.init/1
.