Skip to content

Commit

Permalink
Pass in an ErrorLog to http.Server (#5135)
Browse files Browse the repository at this point in the history
Fixes #5108
  • Loading branch information
jefferai authored Aug 21, 2018
1 parent 224587d commit 1820110
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ CLUSTER_SYNTHESIS_COMPLETE:
ReadHeaderTimeout: 10 * time.Second,
ReadTimeout: 30 * time.Second,
IdleTimeout: 5 * time.Minute,
ErrorLog: c.logger.StandardLogger(nil),
}
go server.Serve(ln.Listener)
}
Expand Down
5 changes: 3 additions & 2 deletions http/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ func TestServerWithListenerAndProperties(tb testing.TB, ln net.Listener, addr st
mux.Handle("/", Handler(props))

server := &http.Server{
Addr: ln.Addr().String(),
Handler: mux,
Addr: ln.Addr().String(),
Handler: mux,
ErrorLog: core.Logger().StandardLogger(nil),
}
go server.Serve(ln)
}
Expand Down
3 changes: 3 additions & 0 deletions vault/request_forwarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ func (c *Core) startForwarding(ctx context.Context) error {
go func() {
fws.ServeConn(tlsConn, &http2.ServeConnOpts{
Handler: fwRPCServer,
BaseConfig: &http.Server{
ErrorLog: c.logger.StandardLogger(nil),
},
})
// close the quitCh which will close the connection and
// the other goroutine.
Expand Down
3 changes: 2 additions & 1 deletion vault/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,8 @@ func NewTestCluster(t testing.T, base *CoreConfig, opts *TestClusterOptions) *Te
var handler http.Handler = http.NewServeMux()
handlers = append(handlers, handler)
server := &http.Server{
Handler: handler,
Handler: handler,
ErrorLog: logger.StandardLogger(nil),
}
servers = append(servers, server)
}
Expand Down

0 comments on commit 1820110

Please sign in to comment.