sim
sim

Reputation: 3602

Hibernate (4.3.11-Final) logging not bridging to log4j2?

We are migrating from log4j to log4j2. We use the following libraries and there logging mechanisms:

Tomcat (which uses JULI), Spring 4.2.0 (which uses commons-logging) and Hibernate 4.3.11-Final (which uses jboss-logging).

I have successfully got Spring bridging to log4j2, but Hibernate logging is not working.

According to the Hibernate docs:

To use JBoss Logging with Log4j2, the log4j2 jar would also need to be available on the classpath.

I have the following logging-related jars on my classpath:

Any ideas why I'm not seeing the results I expect?

Upvotes: 3

Views: 1503

Answers (1)

Thierry
Thierry

Reputation: 5440

The version of jboss-logging included with hibernate-4 is not compatible with log4j2.

I had to import version 3.3.0.Final (should work starting with 3.1.4, according to JBLOGGING-94) for hibernate to work with log4j2.

Here is a shortcut if you use maven :

<dependency> <!-- version working with log4j2 -->
    <groupId>org.jboss.logging</groupId>
    <artifactId>jboss-logging</artifactId>
    <version>3.3.0.Final</version>
    <scope>runtime</scope>
</dependency>

Upvotes: 6

Related Questions