Thanks for your help. I do understand now the concept. I am quite surprised however how much code it actually took. Here is my filter configuration that is working correctly.
This configuration basically filters out everything I don't want in my access logs, including a couple of redundant frameset pages that I do not want to count. LoggingFilter.java is the filter class that adds a parameter to the request object of any page it processes. The tomcat accesslogvalve then only logs requests that do not have the dLog parameter: LoggingFilter.java: package com.mg.filters; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public final class LoggingFilter implements Filter { private FilterConfig filterConfig = null; public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setAttribute(filterConfig.getInitParameter("logParam"),"t"); chain.doFilter(request, response); } public void destroy() { this.filterConfig = null; } public void init(FilterConfig filterConfig) { this.filterConfig = filterConfig; } } Tomcat server.xml: <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve" directory="logs" prefix="access_log." suffix=".txt" pattern="common" resolveHosts="false" condition="dLog" /> web.xml: <!-- The following url patterns will not be written to the access logs --> <filter> <filter-name>LoggingFilter</filter-name> <filter-class>com.mg.filters.LoggingFilter</filter-class> <init-param> <param-name>logParam</param-name> <param-value>dLog</param-value> </init-param> </filter> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/images/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/css/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/js/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/audio/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/dwr/*</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/index.html</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/talk.htm</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>LoggingFilter</filter-name> <url-pattern>/core.htm</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> Any comments or suggestions on this approach? I am not sure if it is neccessary to include all of those dispatcher elements, but it seems to me like it would be necessary to be complete... -- View this message in context: http://www.nabble.com/How-to-configure-Access-logs-to-ignore-images-tp23714046p23716977.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org