Skip to content

Add structured log for request completion with status code and response time #518

Description

@Chucks1093

Summary

The server logs incoming requests but not their outcomes. A structured log emitted after every response is sent — with the status code and total response time — closes the request lifecycle and makes it possible to identify slow or failing endpoints from logs alone.

Scope

  • Emit a structured info log after every response with fields: request_id, method, path, status_code, response_time_ms
  • Log level escalates to warning for responses taking over 1000ms
  • Log level escalates to error for 5xx responses
  • Response time measured from when the request was received

Acceptance Criteria

  • Info log emitted for all successful responses with all five fields
  • Warning log emitted when response time exceeds 1000ms
  • Error log emitted for 5xx responses
  • request_id matches the ID from the request entry log

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions