vishal
vishal

Reputation: 72

HHH000179 warning in hibernate logging - 5.2.10

In cotext of "https://forum.hibernate.org/viewtopic.php?p=2404391" - I have added "org.hibernate.engine.internal.StatefulPersistenceContext" to ERROR in log4j.properties as well tried also "org.hibernate.engine.internal" to ERROR.

However HHH000179 warning is still not getting suppressed.My hibernate version is 5.2.10. I tried to check the code of StatefulPersistenceContext from this version and there is following code:

if ( !alreadyNarrow ) { LOG.narrowingProxy( concreteProxyClass );

Unless here the code adds check for checking if logging level WARN is enabled, how this can be suppressed even mentioning ERROR level for this class?

For tracing level there is code in the same file as:

final boolean tracing = LOG.isTraceEnabled();
    if ( tracing ) {
        LOG.trace( "Serializing persistent-context" );
    }

and I think similar logic should have been there for WARN for suppressing 'HHH000179'

I was cusrious if this has already been addressed or any other ways to suppress this warning?

Upvotes: 1

Views: 5427

Answers (2)

user2104560
user2104560

Reputation:

Try log4j.logger.org.hibernate.engine.internal.StatefulPersistenceContext=ERROR.

For logstash I used

<logger name="org.hibernate.engine.internal.StatefulPersistenceContext" level="ERROR"/>

and it worked for me.

UPD: I agree with the answer below to read that article first. But if you are safe with equals behavior (don't have sets, or compare entities with getId instead of equals or if you weren't safe but secured yourself with proper equals you might want to turn off this annoying message - then you can hide this message because overriding equals doesn't hide it for you.

Upvotes: 3

Rohit
Rohit

Reputation: 78

Please read the info provided in this blog post, which explains the scenario in which the HHH000179 Narrowing proxy to class this operation breaks == warning gets logged.

Upvotes: 2

Related Questions