Log HTTP server errors using common/log

change naming to be more descriptive.
Fixes #1651

remove pointer receiver

use common/log error logger
This commit is contained in:
Ali Reza 2016-05-25 18:13:22 +07:00
parent e1848445f4
commit 624717e801

View File

@ -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) {