項目中記錄log4j記錄日誌

1. 導入如上 log下的對應jar包html

 

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

 

 

3.編寫代碼this

import org.apache.commons.logging.Log;   url

import org.apache.commons.logging.LogFactory;htm

  

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

 

四、附件爲參考例子get

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

相關文章
相關標籤/搜索