-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
Description
Replace the current plain-text tracing output with structured JSON logs. Structured logs are machine-readable and integrate with log aggregation systems like Datadog, Loki, and Elasticsearch.
Requirements:
- Replace
tracing_subscriber::fmt()inmain.rswith a JSON formatter usingtracing-subscriberwith thejsonfeature - Every log entry must include:
timestamp(ISO 8601)level(INFO, WARN, ERROR, DEBUG)messageservice(always"stellar-doc-verifier")target(module path)
- Add request-scoped context to logs using
tracing::Spanso that all logs within a request include:request_id(UUID generated per request via middleware)method(HTTP method)path(request path)
- Create an Axum middleware layer
RequestTracingLayerthat creates a span per request and injectsrequest_id - Log level must be configurable via
LOG_LEVELenv var (default:info)
Acceptance Criteria:
- Every log line is valid JSON parseable by
serde_json - Request logs include
request_idfield LOG_LEVEL=debugenables debug output- Unit test parses a sample log line and asserts required fields are present
Reactions are currently unavailable