code: public void doFilter(ServletRequest servletRequest,
  			ServletResponse servletResponse, FilterChain filterChain)
  			throws IOException, ServletException {
  		HttpServletRequest request = (HttpServletRequest) servletRequest;
  
  		// put values into MDC
  		MDC.put(HOSTNAME, servletRequest.getServerName());
  
  		if (productName != null) {
  			MDC.put(PRODUCTNAME, productName);
  		}
  
  		MDC.put("locale", servletRequest.getLocale().getDisplayName());
  
  		// process plugins
  		for (IPlugin plugin : plugins.values()) {
  			plugin.execute(request);
  		}
  
  		// forward to the chain for processing
  		filterChain.doFilter(servletRequest, servletResponse);
  		MDC.clear();
  	}
docs: Sample filter that populates the MDC on every request.
  
  @param servletRequest
  The request to filter
  @param servletResponse
  The response to filter
  @param filterChain
  The filter chain for this context