logger_json v1.0.1 LoggerJSON.Plug

Implements Plug behaviour and sends connection stats to Logger with metadata:

  • connection.type - type of connection (Sent or Chunked);
  • connection.method - HTTP request method;
  • connection.request_path - HTTP request path;
  • connection.request_id - value of X-Request-ID response header (see Plug.RequestId);
  • connection.status - HTTP status code sent to a client;
  • client.user_agent' - value ofUser-Agentheader; *client.ip’ - value of X-Forwarded-For header if present, otherwise - remote IP of a connected client;

    • client.version' - value ofX-API-Versionheader; *system.hostname- system hostname; *system.pid- Erlang VM process identifier; *runtime.controller- Phoenix controller that processed the request; *runtime.action- Phoenix action that processed the request; *time` - time in microseconds taken to process the request.