1
0
mirror of https://github.com/containous/traefik.git synced 2025-03-19 18:50:12 +03:00

Configure ErrorLog in httputil.ReverseProxy

This commit is contained in:
Daniel Anugerah 2024-12-20 21:18:04 +08:00 committed by GitHub
parent 1c0094048b
commit 95f20fc753
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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