常用的打印日志方法
Posted j_liu.sdc
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了常用的打印日志方法相关的知识,希望对你有一定的参考价值。
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
}
}
以上是关于常用的打印日志方法的主要内容,如果未能解决你的问题,请参考以下文章