about summary refs log tree commit diff stats
path: root/internal/server/tls.go
diff options
context:
space:
mode:
authorAlan Pearce2024-06-29 21:27:35 +0200
committerAlan Pearce2024-06-29 21:27:35 +0200
commit973fa31b6743a3ea84c86ab7671349cc70a69142 (patch)
tree4c583c8ef5e7a9117fe997a4f861ae7466fa0864 /internal/server/tls.go
parent7b82d3ef3e93c0c8efe489d6b11b30f092667bf2 (diff)
downloadwebsite-973fa31b6743a3ea84c86ab7671349cc70a69142.tar.lz
website-973fa31b6743a3ea84c86ab7671349cc70a69142.tar.zst
website-973fa31b6743a3ea84c86ab7671349cc70a69142.zip
enable filtered debug logging via DEBUG="component.*"
Diffstat (limited to 'internal/server/tls.go')
-rw-r--r--internal/server/tls.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/server/tls.go b/internal/server/tls.go
index 6c48f86..655455c 100644
--- a/internal/server/tls.go
+++ b/internal/server/tls.go
@@ -8,7 +8,6 @@ import (
 	"strconv"
 
 	"go.alanpearce.eu/website/internal/listenfd"
-	"go.alanpearce.eu/website/internal/log"
 
 	"github.com/ardanlabs/conf/v3"
 	"github.com/caddyserver/caddy/v2"
@@ -27,10 +26,10 @@ type redisConfig struct {
 
 func (s *Server) serveTLS() (err error) {
 	var issuer *certmagic.ACMEIssuer
+	log := s.log.Named("tls")
 
 	// setting cfg.Logger is too late somehow
-	certmagic.Default.Logger = log.GetLogger().
-		Named("certmagic")
+	certmagic.Default.Logger = log.GetLogger().Named("certmagic")
 	cfg := certmagic.NewDefault()
 	cfg.DefaultServerName = s.config.Domains[0]
 
@@ -97,6 +96,7 @@ func (s *Server) serveTLS() (err error) {
 	ln, err := listenfd.GetListener(
 		1,
 		net.JoinHostPort(s.runtimeConfig.ListenAddress, strconv.Itoa(s.runtimeConfig.Port)),
+		log.Named("listenfd"),
 	)
 	if err != nil {
 		return errors.Wrap(err, "could not bind plain socket")
@@ -127,6 +127,7 @@ func (s *Server) serveTLS() (err error) {
 		0,
 		net.JoinHostPort(s.runtimeConfig.ListenAddress, strconv.Itoa(s.runtimeConfig.TLSPort)),
 		tlsConfig,
+		log.Named("listenfd"),
 	)
 	if err != nil {
 		return errors.Wrap(err, "could not bind tls socket")