View Source LoggerExporter.Loggers.Plug (LoggerExporter v0.2.0)

A plug for logging request information in the format:

method=POST path=/users params=%{"user" => %{"name" => "Juan"}} status=201 duration=101ms

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

plug LoggerExporter.Loggers.Plug,
  log: :debug,
  filter_parameters_fn: &Phoenix.Logger.filter_values/1

Options

  • :log - The log level at which this plug should log its request info. Default is :info. The list of supported levels is available in the Logger documentation.
  • :filter_parameters_fn - The Function to call with conn.params. Filter params that doesn't need to be logged i.e. {"password": "[FILTERED]"}.