logger_json v1.2.0 LoggerJSON.Ecto

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

  • result - the query result as an :ok or :error tuple;
  • query_time - the time spent executing the query in microseconds;
  • decode_time - the time spent decoding the result in microseconds (it may be nil);
  • queue_time - the time spent to check the connection out in microseconds (it may be nil);
  • connection_pid - the connection process that executed the query;
  • caller_pid - the application 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.