skosch
Ecto creates unhelpful query error logs
My application, when encountering a database-related error, logs it as follows:
19:30:04.994 request_id=F4COjwtYrfbnTSkAABcx [debug] QUERY ERROR source="table_xyz" db=0.0ms queue=18.5ms idle=287.9ms SELECT ... FROM ... WHERE ... [1]
19:30:04.994 request_id=F4COjwtYrfbnTSkAABcx [info] Sent 500 in 81ms
19:30:04.994 request_id=F4COjwtYrfbnTSkAABcx [debug] Converted error Postgrex.Error to 500 response
This is eminently unhelpful – for one, this shouldn’t be debug level, but more importantly, it doesn’t show any information about the error itself that would allow me to fix it.
As far as I know, my logger configuration is limited to
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
I’m not sure what else I may have misconfigured to cause this problem, and would be grateful for any ideas where to look next.
Most Liked
benwilson512
Author of Craft GraphQL APIs in Elixir with Absinthe
This is with debug_errors: false.
1
Popular in Questions
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
Hello all!
I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
Hi,
is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
Other popular topics
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
I have a User schema with a :from_id field set to type :string:
defmodule TweetBot.Repo.Migrations.CreateUsers do
use Ecto.Migration
...
New
Hi everyone,
One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
Hi everyone!
I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New







