Skip to content

Conversation

@stampy88
Copy link
Contributor

@stampy88 stampy88 commented May 8, 2025

  • TraceLog now implements the pgxpool.AcquireTracer and pgxpool.ReleaseTracer interfaces to log connection pool interactions.
- `TraceLog` now implements the `pgxpool.AcquireTracer` and `pgxpool.ReleaseTracer` interfaces to log connection pool interactions.
@jackc
Copy link
Owner

jackc commented May 10, 2025

The code seems fine.

But this change could have a side effect of greatly increasing the amount of log output. If someone is mostly using Query, QueryRow, and Exec directly against a pool then the amount of output on the info level would triple. Instead of getting a single log entry for the query, they would get acquire, query, and release log entries.

I'm not sure this is a desirable outcome.

@stampy88
Copy link
Contributor Author

well, I think the additional logging would be useful if you don't have other visibility into your app. Knowing how long it took to acquire a connection is definitely helpful. Also, these log statements are pretty light; they are not like the prepare, query, or even connect in that it is really just timing/error information versus outputting SQL statements and args. One option would be to set this at the debug level instead of info.

@jackc
Copy link
Owner

jackc commented May 10, 2025

Also, these log statements are pretty light; they are not like the prepare, query, or even connect in that it is really just timing/error information versus outputting SQL statements and args.

I'm just thinking about how the volume of messages could be greatly increased.

One option would be to set this at the debug level instead of info.

Let's do that.

@jackc jackc merged commit 777e7e5 into jackc:master May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants