Unverified Commit e7bf7b14 authored by Hussein Galal's avatar Hussein Galal Committed by GitHub

Display cluster tls error only in debug mode (#4201)

parent aa5a0a8c
......@@ -3,6 +3,7 @@ package cluster
import (
"context"
"crypto/tls"
"io/ioutil"
"log"
"net"
"net/http"
......@@ -78,8 +79,11 @@ func (c *Cluster) initClusterAndHTTPS(ctx context.Context) error {
// Create a HTTP server with the registered request handlers, using logrus for logging
server := http.Server{
Handler: handler,
ErrorLog: log.New(logrus.StandardLogger().Writer(), "Cluster-Http-Server ", log.LstdFlags),
Handler: handler}
if logrus.IsLevelEnabled(logrus.DebugLevel) {
server.ErrorLog = log.New(logrus.StandardLogger().Writer(), "Cluster-Http-Server ", log.LstdFlags)
} else {
server.ErrorLog = log.New(ioutil.Discard, "Cluster-Http-Server", 0)
}
// Start the supervisor http server on the tls listener
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment