From 624717e801464e2079d1b8621db7cc69f85d59e1 Mon Sep 17 00:00:00 2001 From: Ali Reza Date: Wed, 25 May 2016 18:13:22 +0700 Subject: [PATCH] Log HTTP server errors using common/log change naming to be more descriptive. Fixes #1651 remove pointer receiver use common/log error logger --- web/web.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/web.go b/web/web.go index 4c345d63e..d321fc041 100644 --- a/web/web.go +++ b/web/web.go @@ -239,7 +239,12 @@ func (h *Handler) Reload() <-chan struct{} { // Run serves the HTTP endpoints. func (h *Handler) Run() { log.Infof("Listening on %s", h.options.ListenAddress) - h.listenErrCh <- http.ListenAndServe(h.options.ListenAddress, h.router) + server := &http.Server{ + Addr: h.options.ListenAddress, + Handler: h.router, + ErrorLog: log.NewErrorLogger(), + } + h.listenErrCh <- server.ListenAndServe() } func (h *Handler) alerts(w http.ResponseWriter, r *http.Request) {