about summary refs log tree commit diff stats
path: root/internal/server/error.go
diff options
context:
space:
mode:
authorAlan Pearce2024-07-01 22:15:06 +0200
committerAlan Pearce2024-07-01 22:15:06 +0200
commit94b21b286edff37496a2fe481963625ac01c30a1 (patch)
treebdfd7803dd4eb22da785331b8547ff9858e2b0e6 /internal/server/error.go
parentf076b5bd6cb82edd99be50f3dbdd39bb9be2c44e (diff)
downloadsearchix-94b21b286edff37496a2fe481963625ac01c30a1.tar.lz
searchix-94b21b286edff37496a2fe481963625ac01c30a1.tar.zst
searchix-94b21b286edff37496a2fe481963625ac01c30a1.zip
feat: more structured logging
Diffstat (limited to 'internal/server/error.go')
-rw-r--r--internal/server/error.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/server/error.go b/internal/server/error.go
index d9d6778..1e04bbc 100644
--- a/internal/server/error.go
+++ b/internal/server/error.go
@@ -1,15 +1,16 @@
 package server
 
 import (
-	"log/slog"
 	"net/http"
 
 	"go.alanpearce.eu/searchix/internal/components"
 	"go.alanpearce.eu/searchix/internal/config"
+	"go.alanpearce.eu/x/log"
 )
 
 func createErrorHandler(
 	config *config.Config,
+	log *log.Logger,
 ) func(http.ResponseWriter, *http.Request, string, int) {
 	return func(w http.ResponseWriter, r *http.Request, message string, code int) {
 		var err error
@@ -31,7 +32,7 @@ func createErrorHandler(
 			err = components.ErrorPage(indexData).Render(r.Context(), w)
 		}
 		if err != nil {
-			slog.Error(
+			log.Error(
 				"error rendering error page template",
 				"error",
 				err,