From 95f20fc753aa3c6f2b408f5691fe0786ae77108b Mon Sep 17 00:00:00 2001 From: Daniel Anugerah Date: Fri, 20 Dec 2024 21:18:04 +0800 Subject: [PATCH] Configure ErrorLog in httputil.ReverseProxy --- pkg/server/service/proxy.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/server/service/proxy.go b/pkg/server/service/proxy.go index 257c4ce0d..13d107a32 100644 --- a/pkg/server/service/proxy.go +++ b/pkg/server/service/proxy.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "io" + stdlog "log" "net" "net/http" "net/http/httputil" @@ -12,6 +13,7 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" ptypes "github.com/traefik/paerser/types" "github.com/traefik/traefik/v2/pkg/config/dynamic" "github.com/traefik/traefik/v2/pkg/log" @@ -81,6 +83,7 @@ func buildProxy(passHostHeader *bool, responseForwarding *dynamic.ResponseForwar Transport: roundTripper, FlushInterval: time.Duration(flushInterval), BufferPool: bufferPool, + ErrorLog: stdlog.New(log.WithoutContext().WriterLevel(logrus.DebugLevel), "", 0), ErrorHandler: func(w http.ResponseWriter, request *http.Request, err error) { statusCode := http.StatusInternalServerError