Hibernate 6.0+ use the wrong logger name for logging the SQL dialect
Description
Activity
Steve Ebersole April 26, 2023 at 3:57 PM
Do I need to make additional changes to the PRs? How are the IDs assigned?
Yes, that’s the crux
At the moment I manually go through all of them and look.
The intention was to leverage https://docs.jboss.org/hibernate/orm/6.0/logging/logging.html which is generated on release. That report is generated using Jandex, which at the time I wrote all of that only had the ability to read annotations with runtime retention. And of course, JBoss Logging annotations are class retention iirc - not runtime at any rate. I know Ladislav planned to change that so that Jandex could read all retentions. He may have already done that, I need to check. At that point, we’d see the registrations in that report.
But at the moment you have to look through the code. I was planning on doing that as I feel bad asking someone else to do it - it is a pita
Sven Strickroth April 26, 2023 at 3:37 PMEdited
I suppose JBoss Logging does not error out because there is no @ValidRange annotation. If this is there, then an “overlap” error will be shown.
I did not add that annotation, because I wanted to keep the old id.
Do I need to make additional changes to the PRs? How are the IDs assigned?
Steve Ebersole April 26, 2023 at 3:33 PM
Yep, I saw the changes. It generally looks good, but there is one change we need to make and I am actually surprised JBoss Logging does not error on it- you use a message id that is reserved by another logger.
Sven Strickroth April 26, 2023 at 9:41 AM
What do you think of https://github.com/hibernate/hibernate-orm/pull/6443 ?
Steve Ebersole April 25, 2023 at 10:52 AM
Create a class named DialectLogging
. Use org.hibernate.boot.BootLogging
as a “template” (or any of the other *Logging
classes).
Name the logger org.hibernate.orm.dialect
Hibernate logs the SQL dialect to the wrong logging context.
The hard-coded term “SQL dialect” is used instead of a class name causing logging configurations to fail.