如何重定向hibernate日志到文件
正在做的项目使用了hibernate,但hibernate的SQL一直只输出到console,并没有写到日志文件
项目使用的是log4j,调了log4j.properties也不起效,后来在hibernate官网发现一条说明:Hibernate utilizes Simple Logging Facade for Java (SLF4J) in order to log various system events.
这才恍然大悟,原来我们的web server启动起来一直报
SLF4J: Found binding in [jar:file:/C:/Users/maxeric/.gradle/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
参考:
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html