hibernate-orm icon indicating copy to clipboard operation
hibernate-orm copied to clipboard

HHH-18224 - standardize logging of database connection

Open jrenaat opened this issue 1 year ago • 6 comments

https://hibernate.atlassian.net/browse/HHH-18224

jrenaat avatar Jun 05 '24 20:06 jrenaat

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

So the other thing I would like to see here is for ProxoolMessageLogger and C3P0MessageLogger go away. I'm hoping we can get to a point where we log exactly the same sorts of info for all the various types of connection pools, at a consistent severity level, instead of logging, say, autocommit mode in one, isolation level in another, etc.

Because right now C3P0 and Proxool are extremely verbose, whereas Agroal and Hikari log almost nothing.

Do you mean as part of this improvement ?

jrenaat avatar Jun 27 '24 16:06 jrenaat

Do you mean as part of this improvement ?

Yeah

gavinking avatar Jun 27 '24 16:06 gavinking

ProxoolMessageLogger

Do you mean as part of this improvement ?

Yeah

~~I kinda feel that we should do this in a separate issue; this one is about 'standardizing' DB connection logging~~

Do you mean as part of this improvement ?

Yeah

I should have also asked, do you mean just simply quit logging all the 'extra' info that c3po/proxool now spit out, or provide some means in the DatabaseConnectionInfo interface (might have to rename if we make it more generalistic) to allow for logging extra information?

jrenaat avatar Jun 27 '24 20:06 jrenaat

I should have also asked, do you mean just simply quit logging all the 'extra' info that c3po/proxool now spit out, or provide some means in the DatabaseConnectionInfo interface (might have to rename if we make it more generalistic) to allow for logging extra information?

The truth is I'm not sure, but remember that what's motivating all this is:

  1. complaints that we were logging too much stuff at INFO level, leading to Quarkus doing stuff like suppressing all our log messages, and then
  2. me realizing that the Agroal CP actually logs almost no information at all, compared to some other CPs.

So, first of all:

  • we want to be able to get to a place where we can tell the Quarkus folks "hey, we're only logging one message and it is really important, so please stop suppressing our INFO-level messages", and
  • if this is a problem in the context of Quarkus, which uses Agroal, it seems like it must be a worse problem for people using the other CPs which are even noisier.

gavinking avatar Jun 28 '24 18:06 gavinking

But also to answer your question more directly: yes, I think it would be nice to include certain very generic things like:

  • autocommit status,
  • isolation level, and
  • pool size

in the DatabaseConnectionInfo, and log it in the "one INFO-level message" that we're permitted.

Of course, which of those things is known to use is going to depend on the CP, but that's OK.

gavinking avatar Jun 28 '24 18:06 gavinking