fix(observabillity): include otel logs
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 5m33s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 5m4s

This commit was merged in pull request #158.
This commit is contained in:
2025-06-07 15:12:18 +02:00
parent e65146c71c
commit 63ade5916e
26 changed files with 231 additions and 185 deletions

View File

@@ -1,8 +1,8 @@
package middleware
import (
"log/slog"
"net/http"
"spend-sparrow/internal/log"
"time"
)
@@ -20,15 +20,13 @@ func Log(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
log.L.Info("request pattern", "pattern", r.Pattern)
wrapped := &WrappedWriter{
ResponseWriter: w,
StatusCode: http.StatusOK,
}
next.ServeHTTP(wrapped, r)
log.L.Info("request",
slog.Info("request",
"remoteAddr", r.RemoteAddr,
"status", wrapped.StatusCode,
"method", r.Method,