1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(logging): replace all the loggers with zerolog EE-4186 (#7663)

This commit is contained in:
andres-portainer 2022-09-16 13:18:44 -03:00 committed by GitHub
parent 53025178ef
commit 36e7981ab7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 1101 additions and 662 deletions

View file

@ -3,15 +3,15 @@ package ssl
import (
"context"
"crypto/tls"
"log"
"os"
"time"
"github.com/pkg/errors"
"github.com/portainer/libcrypto"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/dataservices"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
)
// Service represents a service to manage SSL certificates
@ -45,7 +45,7 @@ func (service *Service) Init(host, certPath, keyPath string) error {
settings, err := service.GetSSLSettings()
if err != nil {
return errors.Wrap(err, "failed fetching ssl settings")
return errors.Wrap(err, "failed fetching SSL settings")
}
// certificates already exist
@ -77,7 +77,8 @@ func generateSelfSignedCertificates(ip, certPath, keyPath string) error {
return errors.New("host can't be empty")
}
log.Printf("[INFO] [internal,ssl] [message: no cert files found, generating self signed ssl certificates]")
log.Info().Msg("no cert files found, generating self signed SSL certificates")
return libcrypto.GenerateCertsForHost("localhost", ip, certPath, keyPath, time.Now().AddDate(5, 0, 0))
}