From 159d1a68e133fa73064f1150f4e5f08b3daa5202 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 28 Jul 2019 09:49:07 +0200 Subject: [PATCH] lib/api: Don't log random stuff in the HTTP server (fixes #5738) (#5897) --- lib/api/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/api/api.go b/lib/api/api.go index d52b7424a..6a32f1813 100644 --- a/lib/api/api.go +++ b/lib/api/api.go @@ -13,6 +13,7 @@ import ( "fmt" "io" "io/ioutil" + "log" "net" "net/http" "net/url" @@ -337,6 +338,9 @@ func (s *service) serve(stop chan struct{}) { // ReadTimeout must be longer than SyncthingController $scope.refresh // interval to avoid HTTP keepalive/GUI refresh race. ReadTimeout: 15 * time.Second, + // Prevent the HTTP server from logging stuff on its own. The things we + // care about we log ourselves from the handlers. + ErrorLog: log.New(ioutil.Discard, "", 0), } l.Infoln("GUI and API listening on", listener.Addr())