Add copy error messages with request id
This commit is contained in:
@@ -211,7 +211,6 @@ func (svc *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
slog.String("path", r.URL.Path),
|
||||
))
|
||||
)
|
||||
|
||||
// Log completion time.
|
||||
defer func() {
|
||||
log.InfoContext(
|
||||
@@ -249,6 +248,9 @@ func (svc *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
log.InfoContext(ctx, "handling")
|
||||
|
||||
// Always set request ID header.
|
||||
w.Header().Set("X-Request-ID", id)
|
||||
|
||||
// Pass the request on to the multiplexer.
|
||||
svc.mux.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user