ibatis在junit中初始化log4j,打印出sql话语

ibatis在junit中初始化log4j,打印出sql语句为了打出个sql语句搞了半天,后来参考了下http://ganlanshu.itey

ibatis在junit中初始化log4j,打印出sql语句
为了打出个sql语句搞了半天,后来参考了下http://ganlanshu.iteye.com/blog/339746这个帖子,终于搞定
在log4j.properties加上

PropertyConfigurator.configure(Test.class.getClassLoader().getResource("log4j.properties"));

初始化log4j(经测试在静态代码块中初始化失败),这样就可以输出sql语句了