1
0
Fork 0

New logger for the Traefik logs

This commit is contained in:
Ludovic Fernandez 2022-11-21 18:36:05 +01:00 committed by GitHub
parent 27c02b5a56
commit 56f7515ecd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
297 changed files with 2337 additions and 1934 deletions

View file

@ -9,7 +9,7 @@ import (
"time"
"github.com/patrickmn/go-cache"
"github.com/traefik/traefik/v2/pkg/log"
"github.com/rs/zerolog/log"
"github.com/traefik/traefik/v2/pkg/safe"
)
@ -40,7 +40,7 @@ func (c CertificateStore) getDefaultCertificateDomains() []string {
x509Cert, err := x509.ParseCertificate(c.DefaultCertificate.Certificate[0])
if err != nil {
log.WithoutContext().Errorf("Could not parse default certificate: %v", err)
log.Error().Err(err).Msg("Could not parse default certificate")
return allCerts
}
@ -81,7 +81,7 @@ func (c *CertificateStore) GetBestCertificate(clientHello *tls.ClientHelloInfo)
// If no ServerName is provided, Check for local IP address matches
host, _, err := net.SplitHostPort(clientHello.Conn.LocalAddr().String())
if err != nil {
log.WithoutContext().Debugf("Could not split host/port: %v", err)
log.Debug().Err(err).Msg("Could not split host/port")
}
serverName = strings.TrimSpace(host)
}