refactor(logging): log with the caller's context so records carry trace ids

This commit is contained in:
sam committed 2026-10-25 23:30:01 +11:00
1 parent 0611e00330
commit 656feab2a4
118 files changed
+512 -511

No files matched your search

+2 -2
View File
@@ -27,7 +27,7 @@ func (s *Server) handleSourcesList(w http.ResponseWriter, r *http.Request) {
}
list, err := s.Sources.ListSources(r.Context())
if err != nil {
s.Log.Error("list sources", "err", err)
s.Log.ErrorContext(r.Context(), "list sources", "err", err)
http.Error(w, "list sources failed", http.StatusInternalServerError)
return
}
@@ -278,7 +278,7 @@ func (s *Server) recentRefusals(r *http.Request) map[string]storecontract.Captur
}
list, err := s.Refusals.CaptureRefusals(r.Context(), s.clock().Add(-24*time.Hour))
if err != nil {
s.Log.Warn("capture refusals unavailable", "err", err)
s.Log.WarnContext(r.Context(), "capture refusals unavailable", "err", err)
return out
}
for _, c := range list {