logger_json v3.0.3 LoggerJSON.Ecto

Implements the behaviour of Ecto.LogEntry and sends query as a string to Logger with additional metadata:

  • query.execution_time_μs - the time spent executing the query in microseconds;
  • query.decode_time_μs - the time spent decoding the result in microseconds (it may be 0);
  • query.queue_time_μs - the time spent to check the connection out in microseconds (it may be 0);
  • query.duration_μs - time the query taken (sum of query_time, decode_time and queue_time);
  • connection_pid - the connection process that executed the query;
  • ansi_color - the color that should be used when logging the entry.

For more information see LogEntry source code.

Link to this section Summary

Functions

Logs query string with metadata from Ecto.LogEntry in with debug level

Overwritten to use JSON

Link to this section Functions

Logs query string with metadata from Ecto.LogEntry in with debug level.

Link to this function

log(entry, level)
log(entry :: Ecto.LogEntry.t(), level :: Logger.level()) :: Ecto.LogEntry.t()

Overwritten to use JSON.

Logs the given entry in the given level.