code: @Override
      public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
          HttpServletRequest req = HttpServletRequest.class.cast(request);
          String url = req.getRequestURI();
  
          LoggerFactory.getLogger(getClass()).debug("Request started: {}", url);
  
          long start = System.currentTimeMillis();
  
          try {
              chain.doFilter(request, response);
          } finally {
              long delta = System.currentTimeMillis() - start;
  
              LoggerFactory.getLogger(getClass()).info("Request completed in {}ms: {}", delta, url);
          }
      }
docs: Logs username, request count and timing information.
  
  @param   request   The HTTP request.
  @param   response  The HTTP response.
  @param   chain     The filter chain to execute.
  
  @throws  IOException       If an I/O exception occurs.
  @throws  ServletException  If an unknown error occurs.