如果使用spring插件创建一个spring template project,它会默认带log4j,只要改下log4j的配置就可以使用了,如果自己创建的project,就要加载下log4f的包了,使用步骤如下
1.pom.xml加入log4j的依赖包
[html]
org.slf4j
slf4j-api
1.6.6
org.slf4j
jcl-over-slf4j
1.6.6
runtime
org.slf4j
slf4j-log4j12
1.6.6
runtime
2.在src/main/resources下创建log4j.xml
[html]
更多关注: