Skip to main content

log_requests

Function log_requests 

Source
pub async fn log_requests(request: Request, next: Next) -> Response
Expand description

Logs an incoming request and its response through the doido logger.

Two events flow through the global tracing subscriber per exchange, sharing a request_id: a request line when it arrives (method, path, query, request headers), and a response line once the response is ready (status, latency, response headers). Both run inside a request span so nested events (e.g. SQL queries) correlate back to the originating request.