From e390ca6047a873346d2dd30dd6234062c9e98e89 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Mon, 1 Jan 2024 14:53:57 +0100 Subject: [PATCH] feat: Log certificate actions using Info --- internal/server/tls.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/server/tls.go b/internal/server/tls.go index b73ee9d..160a93d 100644 --- a/internal/server/tls.go +++ b/internal/server/tls.go @@ -77,12 +77,14 @@ func MakeTlsConfig(pagesDomain, cachePath string, cache *certificates.Certificat defer unlockDomain(domain) // Renew - log.Debugf("Certificate for %s expired, renewing", domain) + log.Infof("Certificate for %s expired, renewing", domain) newCert, err := certificates.RenewCertificate(&cert, acmeClient) if err != nil { log.Errorf("Failed to renew certificate for %s: %v", domain, err) return cert.TlsCertificate, nil } + + log.Info("Successfully renewed certificate!") cache.AddCert(newCert, cachePath) return newCert.TlsCertificate, nil } @@ -94,7 +96,7 @@ func MakeTlsConfig(pagesDomain, cachePath string, cache *certificates.Certificat defer unlockDomain(domain) // Request new certificate - log.Debugf("Obtaining new certificate for %s...", domain) + log.Infof("Obtaining new certificate for %s...", domain) cert, err := certificates.ObtainNewCertificate( []string{domain}, acmeClient, @@ -109,6 +111,7 @@ func MakeTlsConfig(pagesDomain, cachePath string, cache *certificates.Certificat } // Add to cache and flush + log.Info("Successfully obtained new certificate!") cache.AddCert(cert, cachePath) return cert.TlsCertificate, nil }