package server

import (
	"net/http"
	"time"

	"github.com/influxdata/chronograf"
)

// Logger is middleware that logs the request
func Logger(logger chronograf.Logger, next http.Handler) http.Handler {
	fn := func(w http.ResponseWriter, r *http.Request) {
		now := time.Now()
		logger.
			WithField("component", "server").
			WithField("remote_addr", r.RemoteAddr).
			WithField("method", r.Method).
			WithField("url", r.URL).
			Info("Request")
		next.ServeHTTP(w, r)
		later := time.Now()
		elapsed := later.Sub(now)

		logger.
			WithField("component", "server").
			WithField("remote_addr", r.RemoteAddr).
			WithField("response_time", elapsed.String()).
			Info("Success")
	}
	return http.HandlerFunc(fn)
}

package server

import (
	"net/http"

	"github.com/influxdata/chronograf"
)

// Logger is middleware that logs the request
func Logger(logger chronograf.Logger, next http.Handler) http.Handler {
	fn := func(w http.ResponseWriter, r *http.Request) {
		logger.
			WithField("component", "server").
			WithField("remote_addr", r.RemoteAddr).
			WithField("method", r.Method).
			WithField("url", r.URL).
			Info("Request")
		next.ServeHTTP(w, r)
	}
	return http.HandlerFunc(fn)
}

--- 
+++ 
@@ -2,6 +2,7 @@
 
 import (
 	"net/http"
+	"time"
 
 	"github.com/influxdata/chronograf"
 )
@@ -9,6 +10,7 @@
 // Logger is middleware that logs the request
 func Logger(logger chronograf.Logger, next http.Handler) http.Handler {
 	fn := func(w http.ResponseWriter, r *http.Request) {
+		now := time.Now()
 		logger.
 			WithField("component", "server").
 			WithField("remote_addr", r.RemoteAddr).
@@ -16,6 +18,14 @@
 			WithField("url", r.URL).
 			Info("Request")
 		next.ServeHTTP(w, r)
+		later := time.Now()
+		elapsed := later.Sub(now)
+
+		logger.
+			WithField("component", "server").
+			WithField("remote_addr", r.RemoteAddr).
+			WithField("response_time", elapsed.String()).
+			Info("Success")
 	}
 	return http.HandlerFunc(fn)
 }
Add logging of response times

This makes monitoring Chronograf :+1:
