Revert "Print golang http errors in MinIO log format (#16465)"

This reverts commit 1fd7946dce.
This commit is contained in:
Harshavardhana 2023-02-09 09:27:27 +05:30
parent 9de26531e4
commit 71f02adfca
2 changed files with 1 additions and 11 deletions

View File

@ -590,7 +590,7 @@ func serverMain(ctx *cli.Context) {
UseIdleTimeout(ctx.Duration("idle-timeout")).
UseReadHeaderTimeout(ctx.Duration("read-header-timeout")).
UseBaseContext(GlobalContext).
UseCustomLogger(log.New(&goHTTPLogger{}, "", 0))
UseCustomLogger(log.New(io.Discard, "", 0)) // Turn-off random logging by Go stdlib
go func() {
globalHTTPServerErrorCh <- httpServer.Start(GlobalContext)

View File

@ -1245,13 +1245,3 @@ func MockOpenIDTestUserInteraction(ctx context.Context, pro OpenIDClientAppParam
// fmt.Printf("TOKEN: %s\n", rawIDToken)
return rawIDToken, nil
}
// Custom logger for golang http logs
type goHTTPLogger struct{}
func (goHTTPLogger) Write(p []byte) (int, error) {
// Golang std logger ensures that the error message will be sent
// in one Write call so it is okay to print it directly.
logger.LogOnceIf(context.Background(), fmt.Errorf("%s", string(p)), "go-http-logging")
return len(p), nil
}