Hibernate 4.3.6 logging doesn't work with log4j2
I just can't get hibernate to write anything with the following configuration:
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.5.Final</version>
</dependency>
</dependencies>
Here is my log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" >
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
</Appenders>
<Loggers>
<Root level="all">
<AppenderRef ref="CONSOLE" />
</Root>
<Logger name="org.hibernate" level="all"/>
</Loggers>
</Configuration>
I also added System.setProperty("org.jboss.logging.provider", "log4j2")
to my main method as stated http://docs.jboss.org/hibernate/orm/4.3/topical/html/logging/Logging.html
but no effect. Any pointers?
thank
+3
source to share
1 answer
This error report indicates that the Log4j2 log bridge is broken. he throws NPE! Has anyone experienced this at all prior to graduation? I am planning to do a traversal via SLF4j
+4
source to share