Log host name for each request

This commit is contained in:
Matt Baer 2020-10-08 12:59:31 -04:00
parent b969e40fb4
commit 5e11c443eb

View File

@ -19,7 +19,7 @@ func viewPage(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Error", http.StatusInternalServerError)
}
log.Info(fmt.Sprintf("\"%s %s\" %s \"%s\"", r.Method, r.RequestURI, time.Since(start), r.UserAgent()))
log.Info(fmt.Sprintf("\"%s %s\" %s \"%s\" \"%s\"", r.Method, r.RequestURI, time.Since(start), r.UserAgent(), r.Host))
}()
name := r.URL.Path[1:]