1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00

fix(http): log HTTP server errors as DEBUG level EE-5225 (#9060)

This commit is contained in:
andres-portainer 2023-06-12 09:54:28 -03:00 committed by GitHub
parent 2d69e93efa
commit 424c98e256
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 2 deletions

View file

@ -327,13 +327,16 @@ func (server *Server) Start() error {
WebhookHandler: webhookHandler,
}
errorLogger := NewHTTPLogger()
handler := adminMonitor.WithRedirect(offlineGate.WaitingMiddleware(time.Minute, server.Handler))
if server.HTTPEnabled {
go func() {
log.Info().Str("bind_address", server.BindAddress).Msg("starting HTTP server")
httpServer := &http.Server{
Addr: server.BindAddress,
Handler: handler,
Addr: server.BindAddress,
Handler: handler,
ErrorLog: errorLogger,
}
go shutdown(server.ShutdownCtx, httpServer)
@ -349,6 +352,7 @@ func (server *Server) Start() error {
httpsServer := &http.Server{
Addr: server.BindAddressHTTPS,
Handler: handler,
ErrorLog: errorLogger,
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)), // Disable HTTP/2
}