0
我有一個桌面Java(1.8.0_40)應用程序在Maven項目。這是我對pom.xml
Hibernate和的logback庫:Logback不工作休眠
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ... -->
<dependencies>
<!-- ... -->
<!-- Bibliotecas de log -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.2</version>
</dependency>
<!-- Fim - Bibliotecas de log -->
<!-- Banco -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.8.Final</version>
</dependency>
<!-- ... -->
</dependencies>
</project>
這裏是我的logback.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="LB_STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{dd/MM/yyyy HH:mm:ss.SSS} %-5level {%thread} [%logger{40}] : %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<!-- ... file appenders -->
<logger name="org.hibernate.type" level="ALL" />
<logger name="org.hibernate" level="DEBUG" />
<root level="DEBUG">
<appender-ref ref="LB_STDOUT" level="DEBUG" />
<appender-ref ref="LB_FILE" level="DEBUG" />
<appender-ref ref="LB_FILE_ERRORS" level="ERROR" />
</root>
</configuration>
當我運行應用程序,所有的業務類都在NetBeans控制檯被記錄.. 。例如:
08/04/2015 12:31:50.781 INFO {AWT-EventQueue-0} [o.repository.RepositorySysPDVImpl] : Inicializando lista de produtos para exportação.
但是休眠日誌被忽略。
有什麼我失蹤了嗎?我有一個類似的logback.xml
Web應用程序的文件,它的工作原理,但對於這個桌面應用程序,它不是。