Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Disable ErrorLog in http.Server
  • Loading branch information
kylecarbs committed May 1, 2022
commit 3bbd23591cff419fdf8410b31e301690c71e664c
7 changes: 6 additions & 1 deletion cli/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"encoding/pem"
"errors"
"fmt"
"io"
"log"
"net"
"net/http"
"net/url"
Expand Down Expand Up @@ -263,7 +265,10 @@ func server() *cobra.Command {
go func() {
defer close(errCh)
server := http.Server{
Handler: handler,
// These errors are typically noise like "TLS: EOF". Vault does similar:
// https://github.com/hashicorp/vault/blob/e2490059d0711635e529a4efcbaa1b26998d6e1c/command/server.go#L2714
ErrorLog: log.New(io.Discard, "", 0),
Handler: handler,
BaseContext: func(_ net.Listener) context.Context {
return shutdownConnsCtx
},
Expand Down