首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

知识点拾掇之Web项目中Log4J的初始化

2012-06-30 
知识点整理之Web项目中Log4J的初始化首先在web.xml中定义一个servlet,执行初始化public void init(Servlet

知识点整理之Web项目中Log4J的初始化

首先在web.xml中定义一个servlet,执行初始化

public void init(ServletConfig config) throws ServletException {    String prefix = config.getServletContext().getRealPath("/");    // Log4J    String log4jFile = config.getInitParameter("log4j");    String log4jConfigPath = prefix + log4jFile;    PropertyConfigurator.configure(log4jConfigPath);}
?

热点排行