Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Disable hibernate 6.1.5.Final from logging envers-generated HBM mapping

Hello StackOverflow Community,

Attempted:

Upgrading Spring Boot from 2.7.5 to 3.0.0, which uses Hibernate ORM core version 6.1.5.Final

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Issue:

After upgrade, hibernate logs XML of envers-generated HBM mapping in logs as below,

2023-03-07T16:50:59.558-05:00 DEBUG 27508 --- [           main] ca.dev.cicd.DbTestApp                    : Running with Spring Boot v3.0.0, Spring v6.0.2
...
2023-03-07T16:51:03.206-05:00  INFO 27508 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.1.5.Final
2023-03-07T16:51:03.464-05:00  WARN 27508 --- [           main] org.hibernate.orm.deprecation            : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
2023-03-07T16:51:04.226-05:00  INFO 27508 --- [           main] SQL dialect                              : HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect
2023-03-07T16:51:04.373-05:00  INFO 27508 --- [           main] o.h.e.boot.internal.EnversServiceImpl    : Envers integration enabled? : true
2023-03-07T16:51:05.231-05:00  INFO 27508 --- [           main] o.h.e.c.i.m.AuditMetadataGenerator       : Adding properties for entity: [class-names]
2023-03-07T16:51:05.243-05:00  INFO 27508 --- [           main] .e.b.i.AdditionalJaxbMappingProducerImpl : Adding JAXB document mapping
2023-03-07T16:51:05.600-05:00  INFO 27508 --- [           main] org.hibernate.envers.boot                : HHH90005601: Envers-generated HBM mapping...
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hibernate-mapping auto-import="false" xmlns="http://www.hibernate.org/xsd/orm/hbm">
   <class>
      ...
   </class>
</hibernate-mapping>

Question:

How to prevent/disable the envers-generated XML from being logged?

>Solution :

You can disable the logs of this class configuring your application.

application.properties:

logging.level.org.hibernate.envers.boot = OFF

application.yml:

logging:
    level:
        org.hibernate.envers.boot: OFF
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading