RSS
热门关键字:  java  Ajax  JSP  JSF  Struts
当前位置 : 首页>Java>列表

J2SE综合-对于log4j的深层次的理解

来源: 作者: 时间:2008-03-03 点击:

public BeanCollection selectAll() throws SQLException{
StringBuffer sql = new StringBuffer(SQLBUF_LEN);sql.append("SELECT * FROM " + tableName + " order by roldId");
//System.out.println(sql.toString());log.debug(sql);
}
}

3.3 
使用Logger对象的debug,info,fatal...方法
log.debug("it is the debug info");

附件1:log4j的一个bug
当这样使用时,DailyRollingFileAppender不能正确使用:
public Class RoleDAO(){
static Logger log = Logger.getLogger("DAO");
//在每一次new RoleDAO对象的时候都执行一次configure()操作
public RoleDAO(TransactionManager transMgr) throws SQLException{...PropertyConfigurator.configure("log4j.properties");}
public void select(){...//使用log4j进行log记录log.debug("...");
}
}

共4页: 上一页 [1] [2] [3] 4 下一页
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
Google Adsense
相关文章