LoggerJSON.Ecto (logger_json v4.3.0) View Source
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
andqueue_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
Specs
Logs query string with metadata from Ecto.LogEntry
in with debug level.
Specs
log(entry :: map(), level :: Logger.level()) :: map()
Overwritten to use JSON.
Logs the given entry in the given level.
Specs
telemetry_logging_handler( event_name :: [atom()], query_time :: %{ query_time: non_neg_integer(), queue_time: non_neg_integer(), decode_time: non_neg_integer(), total_time: non_neg_integer() }, log_entry :: map(), level :: Logger.level() ) :: :ok