Skip to main content

Module logging

Module logging 

Source
Expand description

Request/response logging middleware.

log_requests logs each incoming request and its response through the framework’s centralized logger (doido_core::logger), so every HTTP exchange flows through the same tracing subscriber as jobs, mail and ORM queries. It is wired into the always-on [MiddlewareStack] (crate::stack).

A per-request UUID (request_id) ties the request and response log lines together; it is taken from an inbound x-request-id header when present (so an upstream proxy’s id is preserved) or generated otherwise, and echoed back on the response so clients can correlate too. The request line carries the method, path, query and request headers; the response line carries the status, latency and response headers.

Functions§

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