项目中记录log4j记录日志

1. 导入如上 log下的对应jar包

 

2. 在src下新建log4j.properties文件,类容如(详细配置:http://www.cnblogs.com/suman/archive/2010/10/23/1858864.html )

 

 

3.编写代码

import org.apache.commons.logging.Log;   

import org.apache.commons.logging.LogFactory;

  

Log log = LogFactory.getLog( this .getClass());   

 

4、附件为参考例子

https://files.cnblogs.com/files/richelle009/log4j.rar

 

posted on 2016-04-05 08:52  想飞的小丑鱼  阅读(130)  评论(1编辑  收藏  举报

导航