code: private void logPerformance(ServletResponse response, long startTime, String url, Throwable error) {
  
      long endTime, duration;
      int statusCode = ((HttpServletResponse) response).getStatus();
      endTime = System.nanoTime();
      duration = TimeUnit.MILLISECONDS.convert(endTime - startTime, TimeUnit.NANOSECONDS);
  
      String errorClass = "";
      String errorMessage = "";
      if (error != null) {
        statusCode = HttpStatus.SC_INTERNAL_SERVER_ERROR;
        errorClass = error.getClass().getName();
        errorMessage = error.getMessage();
      }
      String message =
          createMessage(url, Long.toString(duration), Integer.toString(statusCode), errorClass, errorMessage);
      LOG.info(message);
    }
docs: Logs the request URL, execution time and {@link HttpStatus}. In case of an error also logs class name and error
  message.
  
  @param response - the {@link ServletResponse}
  @param startTime - start time of the {@link #doFilter(ServletRequest, ServletResponse, FilterChain)} function
  @param url - requested URL
  @param error - error thrown by the requested servlet, {@code null} if execution did not cause an error