码迷,mamicode.com
首页 > 其他好文 > 详细

项目中记录log4j记录日志

时间:2016-04-05 09:25:13      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:

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、附件为参考例子

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

 

项目中记录log4j记录日志

标签:

原文地址:http://www.cnblogs.com/richelle009/p/5353745.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!