Log4j2/JPA/Hibernate logging is not working

北战南征 提交于 2019-12-05 00:50:30

Hibernate logs with jboss-logging. Now Hibernate 4.3.7.Final uses jboss-logging 3.1.3.GA which does not support any binding with log4j2, BUT its last version (3.2.0.Final) already does, so the only thing you need to do is to add the new one:

<!-- HIBERNATE -->
<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.3.7.Final</version>
</dependency>
<dependency>
    <groupId>org.jboss.logging</groupId>
    <artifactId>jboss-logging</artifactId>
    <version>3.2.0.Final</version>
</dependency>
<!-- HIBERNATE -->

I found the solution. Hibernate definitely uses jboss-logging, so the version coming with hibernate-core and hibernate-entitymanager is 3.1.3.GA and when it gets upgraded to the latest 3.2.0.Final everything has started to work normally.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!