搭建Hibernate日志-log4jdbc

官方: https://code.google.com/p/log4jdbc/
log4jdbc分析sql性能 http://hongliangpan.iteye.com/blog/1088398
xml配置方法: log4jdbc日志框架介绍 http://blog.sina.com.cn/s/blog_57769b7b0101m1il.html

http://xiaominghimi.blog.51cto.com/2614927/969781

log4j不能使用1.2.15版本,否则丢失包,浪费时间

启动程序改为:
jdbc.driver=net.sf.log4jdbc.DriverSpy
jdbc.url=jdbc:log4jdbc:sqlserver//localhost:1433;DatabaseName=Test
在jdbc和sqlserver之间加上log4jdbc,就变成了jdbc:log4jdbc:sqlserver
比如mysql就应该写成: jdbc:log4jdbc:mysql://localhost:3306/jbpmtest
Easy to configure, in most cases all you need to do is change the driver class name to net.sf.log4jdbc.DriverSpy and prepend “jdbc:log4” to your existing jdbc url, set up your logging categories and you’re ready to go!

log4j.properties

两种配置参考
log4j.xml

log4j.properties