Skip to content

Commit

Permalink
Added Zap as the default Error log #11820
Browse files Browse the repository at this point in the history
  • Loading branch information
tarun-kavipurapu committed Dec 11, 2024
1 parent a9f3aeb commit 6582f98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config/confighttp/confighttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/noop"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/net/http2"
"golang.org/x/net/publicsuffix"

Expand Down Expand Up @@ -480,14 +481,14 @@ func (hss *ServerConfig) ToServer(_ context.Context, host component.Host, settin
next: handler,
includeMetadata: hss.IncludeMetadata,
}
errorLog, _ := zap.NewStdLogAt(settings.Logger, zapcore.ErrorLevel)
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),
ErrorLog: errorLog,
}

return server, nil
Expand Down

0 comments on commit 6582f98

Please sign in to comment.