Skip to content

Commit 9b37a0d

Browse files
authored
fix: Disable ErrorLog in http.Server (#1244)
Vault does similarly: https://github.com/hashicorp/vault/blob/e2490059d0711635e529a4efcbaa1b26998d6e1c/command/server.go#L2714 These messages have primarily been noise.
1 parent b948f2d commit 9b37a0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cli/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
"encoding/pem"
99
"errors"
1010
"fmt"
11+
"io"
12+
"log"
1113
"net"
1214
"net/http"
1315
"net/url"
@@ -263,7 +265,10 @@ func server() *cobra.Command {
263265
go func() {
264266
defer close(errCh)
265267
server := http.Server{
266-
Handler: handler,
268+
// These errors are typically noise like "TLS: EOF". Vault does similar:
269+
// https://github.com/hashicorp/vault/blob/e2490059d0711635e529a4efcbaa1b26998d6e1c/command/server.go#L2714
270+
ErrorLog: log.New(io.Discard, "", 0),
271+
Handler: handler,
267272
BaseContext: func(_ net.Listener) context.Context {
268273
return shutdownConnsCtx
269274
},

0 commit comments

Comments
 (0)