summaryrefslogtreecommitdiff
path: root/modules/caddytls
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddytls')
-rw-r--r--modules/caddytls/tls.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go
index 5054081..5dfe063 100644
--- a/modules/caddytls/tls.go
+++ b/modules/caddytls/tls.go
@@ -18,7 +18,6 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
- "log"
"net/http"
"sync"
"time"
@@ -26,6 +25,7 @@ import (
"github.com/caddyserver/caddy/v2"
"github.com/go-acme/lego/v3/challenge"
"github.com/mholt/certmagic"
+ "go.uber.org/zap"
)
func init() {
@@ -43,6 +43,7 @@ type TLS struct {
ctx caddy.Context
storageCleanTicker *time.Ticker
storageCleanStop chan struct{}
+ logger *zap.Logger
}
// CaddyModule returns the Caddy module information.
@@ -56,6 +57,7 @@ func (TLS) CaddyModule() caddy.ModuleInfo {
// Provision sets up the configuration for the TLS app.
func (t *TLS) Provision(ctx caddy.Context) error {
t.ctx = ctx
+ t.logger = ctx.Logger(t)
// set up a new certificate cache; this (re)loads all certificates
cacheOpts := certmagic.CacheOptions{
@@ -290,7 +292,7 @@ func (t *TLS) cleanStorageUnits() {
storageClean = time.Now()
- log.Println("[INFO] tls: Cleaned up storage unit(s)")
+ t.logger.Info("cleaned up storage units")
}
// CertificateLoader is a type that can load certificates.