工作我根本無法得到休眠模式,下面的配置記錄任何東西:的Hibernate 4.3.6記錄不log4j2
<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>
這裏是我的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>
我還添加在System.setProperty("org.jboss.logging.provider", "log4j2")
我的主要方法 由http://docs.jboss.org/hibernate/orm/4.3/topical/html/logging/Logging.html 指定但沒有效果。任何指針?
感謝
我終於發現了什麼是錯的。 jboss日誌log4j2被破壞!!!! jboss.logging中的Log4j2支持僅在3.2.0.Beta1中通過'Log4j2Logger'添加。但是[日誌調用](http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.jboss.logging/jboss-logging/3.2.0.Beta1/org/jboss /logging/Log4j2Logger.java?av=f#68)它完全破碎! Log4j2中沒有接受null作爲第一個參數的'log'方法。我是第一個注意到這個的人嗎? jboss團隊如何做出這樣的失誤? – sha 2014-09-30 07:56:27