pg_net
pg_net copied to clipboard
Optionally log based on status code responses
Can we optionally log something based on the status code when the response is handled?
Default to logging 4xx - 5xx response codes would be great, and then everyone would automatically get this info in their Postgres logs.
Yeah, that can be done by using a call to elog in the background worker.
Can we optionally log something based on the status code when the response is handled?
We should have a config to turn this on/off, maybe named like pg_net.log_http_errors(off by default).
Do all responses get put in the table you collect responses from? Maybe we just build a UI over that? I thought I read somewhere a concept of sync vs async, but maybe either way they end up in the collect response table?
I'm assuming actual connection errors will end up in the logs though. Is this correct?
The response table is private API and subject to breakage, so we should probably avoid that. But yes, they end up in the response table.
I don't think we log connection errors right now, only for debugging purposes.