fmeringdal / nettu-scheduler

A self-hosted calendar and scheduler server.
MIT License
535 stars 27 forks source link

Log errors on query failure #17

Closed omid closed 3 years ago

omid commented 3 years ago

For some of the queries, if the query fails (eg. db connection failure) it's not possible to track down the error. The code below is one example: https://github.com/fmeringdal/nettu-scheduler/blob/master/scheduler/crates/infra/src/repos/account/postgres.rs#L125

fmeringdal commented 3 years ago

You are correct. Some queries have error logs enabled, like this one. I think that is a copy paste job needed to have that error logging enabled for all queries. I also think if RUST_LOG=error env var is set then sqlx error logging will be enabled, but those logs will be too noisy and hard to track down the error origin from.