all repos — website @ b8377dd9585af5dec8aee7baea91d1c97a17e44b

My website

set certmagic logger properly
Alan Pearce alan@alanpearce.eu
Mon, 09 Dec 2024 18:29:42 +0100
commit

b8377dd9585af5dec8aee7baea91d1c97a17e44b

parent

a7b9a089b0ec645fec1ee21e0fb48194483957a2

1 files changed, 2 insertions(+), 3 deletions(-)

jump to
M internal/server/tls.gointernal/server/tls.go
@@ -33,9 +33,8 @@ 	wildcardDomain := "*." + s.config.WildcardDomain
 	certificateDomains := slices.Clone(s.config.Domains)
 
-	// setting cfg.Logger is too late somehow
-	certmagic.Default.Logger = log.GetLogger().Named("certmagic")
 	cfg := certmagic.NewDefault()
+	cfg.Logger = log.GetLogger().Named("certmagic")
 
 	acme := certmagic.DefaultACME
 	acme.Agreed = true
@@ -82,7 +81,7 @@ 		acme.DNS01Solver = &certmagic.DNS01Solver{
 			DNSManager: certmagic.DNSManager{
 				DNSProvider: pdns,
-				Logger:      certmagic.Default.Logger,
+				Logger:      cfg.Logger,
 			},
 		}