1 5 6 package org.joseki.server.webserver.servlets; 7 8 import org.apache.commons.logging.*; 9 import javax.servlet.*; 10 import javax.servlet.http.*; 11 import java.io.*; 12 13 17 public class LogFilter implements Filter 18 { 19 static Log log = LogFactory.getLog(LogFilter.class) ; 20 21 private FilterConfig filterConfig = null; 22 23 public void init(FilterConfig filterConfig) throws ServletException 24 { 25 this.filterConfig = filterConfig; 26 } 27 28 public void destroy() 29 { 30 } 31 32 public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 33 throws IOException, ServletException 34 { 35 if ( request instanceof HttpServletRequest ) 36 { 37 String uri = ((HttpServletRequest)request).getRequestURI() ; 38 log.info("Request: "+uri) ; 39 } 40 41 chain.doFilter(request, response); 42 } 43 } 44 45 71 | Popular Tags |