From 57e4cf0c646b3186610fc6d4ceff8bed0e09fcd0 Mon Sep 17 00:00:00 2001 From: Tarun Date: Tue, 10 Dec 2024 00:08:18 +0530 Subject: [PATCH] Added Zap as the default Error log open-telemetry#11820 --- config/confighttp/confighttp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go index 69ac3900fe5..9d0aad08d21 100644 --- a/config/confighttp/confighttp.go +++ b/config/confighttp/confighttp.go @@ -20,6 +20,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/noop" + "go.uber.org/zap" "golang.org/x/net/http2" "golang.org/x/net/publicsuffix" @@ -479,13 +480,14 @@ func (hss *ServerConfig) ToServer(_ context.Context, host component.Host, settin next: handler, includeMetadata: hss.IncludeMetadata, } - server := &http.Server{ Handler: handler, ReadTimeout: hss.ReadTimeout, ReadHeaderTimeout: hss.ReadHeaderTimeout, WriteTimeout: hss.WriteTimeout, IdleTimeout: hss.IdleTimeout, + // Setting the server error logger + ErrorLog: zap.NewStdLog(settings.Logger), } return server, nil