refactor(logging): log with the caller's context so records carry trace ids
This commit is contained in:
1 parent
0611e00330
commit
656feab2a4
118 files changed
+512
-511
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user