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

常用的打印日志方法

时间:2017-10-09 17:49:05      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:todo   tor   override   ati   throws   gen   des   imp   request   

import org.apache.log4j.Logger;

public class MyFilter implements Filter {
Logger log = Logger.getLogger(this.getClass().getName());

// private static final Log log = LogFactory.getLog(MyFilter.class);
@Override
public void destroy() {
// TODO Auto-generated method stub

}

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
// TODO Auto-generated method stub
HttpServletRequest rq=(HttpServletRequest)request;
log.info("用户执行:"+rq.getRequestURL());

chain.doFilter(request,response);
}

@Override
public void init(FilterConfig arg0) throws ServletException {
// TODO Auto-generated method stub

}

}

常用的打印日志方法

标签:todo   tor   override   ati   throws   gen   des   imp   request   

原文地址:http://www.cnblogs.com/j-liu3323/p/7641876.html

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