[hibernate-dev] [ORM] Reducing startup log verbosity

Guillaume Smet guillaume.smet at gmail.com
Wed Jan 2 10:34:21 EST 2019


Hi,

Got a report from a fellow Red Hatter complaining about our logging
verbosity being so 2004 and, well, I must admit I tend to agree.

This is from a launch on a simple PostgreSQL app. I added some comments
inline.

Note that it might seem like wasting our time but I would like to improve
the user experience in some contexts - happy to discuss the rationale
behing this discussion privately if needed.

[o.h.Version] (build-) HHH000412: Hibernate Core {5.4.0.Final}
-> this one is a product requirement so let's keep it as is for now,
hopefully, we will have a global solution for that at some point

[o.h.c.Environment] (build-) HHH000206: hibernate.properties not found
-> I think we should use DEBUG here, framework nowadays rely on their own
config injection mechanisms

[o.h.b.e.s.Enhancer] (pool-2-thread-6) Enhancing [jpa.SequencedAddress] as
Entity
[o.h.b.e.s.Enhancer] (pool-2-thread-10) Enhancing [jpa.WorkAddress] as
Composite
[o.h.b.e.s.Enhancer] (pool-2-thread-1) Enhancing [jpa.Address] as Composite
[o.h.b.e.s.Enhancer] (pool-2-thread-8) Extended enhancement of [jpa.Animal]
[o.h.b.e.s.Enhancer] (pool-2-thread-13) Enhancing [jpa.Human] as
MappedSuperclass
[o.h.b.e.s.Enhancer] (pool-2-thread-16) Enhancing [jpa.Person] as Entity
[o.h.b.e.s.Enhancer] (pool-2-thread-5) Enhancing [jpa.Customer] as Entity

-> I would vote for using DEBUG. Let's imagine a 250 entities model and I
think we can agree we don't want it to be logged by default.

[o.h.j.i.u.LogHelper] (main) HHH000204: Processing PersistenceUnitInfo [
    name: templatePU
    ...]

-> so, first, I would make this one a one liner as we apparently didn't add
any other properties. I think it was done to mimic the DEBUG output but I
don't see any value to having it on several lines.

And, frankly, I think I would get rid of it altogether and only log
something at debug level.

[o.h.a.c.Version] (main) HCANN000001: Hibernate Commons Annotations
{5.1.0.Final}

-> version, can't touch it for now.

[o.h.d.Dialect] (main) HHH000400: Using dialect:
org.hibernate.dialect.PostgreSQL95Dialect

-> wondering if it has any value to log the dialect? I mean if you don't
use the right one, you will definitely have some issues.

[o.h.e.j.e.i.LobCreatorBuilderImpl] (main) HHH000422: Disabling contextual
LOB creation as connection was null

-> I would move that to DEBUG.

[o.h.t.BasicTypeRegistry] (main) HHH000270: Type registration
[java.util.UUID] overrides previous :
org.hibernate.type.UUIDBinaryType at 7e8dcdaa

-> as I understand it, we will always have this message at startup when
using PostgreSQL. I think we should make it DEBUG too. Or find another
solution for this specific case but having it logged on each PostgreSQL app
is definitely a bad thing.

[o.h.e.t.j.p.i.JtaPlatformInitiator] (main) HHH000490: Using JtaPlatform
implementation:
[org.hibernate.engine.transaction.jta.platform.internal.JBossStandAloneJtaPlatform]

-> This one, I don't know. It's probably important to know that JTA is
properly configured but I'm not terribly excited about keeping it. Thoughts?

Maybe one solution could be to have all these ones tied to a
"org.hibernate.bootstrap" logger and thus have the ability to enable them
in one go.

I heard you made nice things in 6 about logging but I would like to improve
the situation in the stable version.

I would like to move quickly on this and hopefully integrate it in the
upcoming 5.4.1 so feedback very welcome! If some are polemic, I will just
work on the easy ones, that would still improve the situation.

Thanks!

-- 
Guillaume


More information about the hibernate-dev mailing list