Add readable configurable request and SQL logging
Provide clean Rails-like development logging for the identity platform server, configurable without code changes. Scope: - Readable request start/completion records with correlation ID, status, elapsed time, and useful SQL timing/counts. - Concise PostgreSQL statement logging without bind values, credentials, request bodies, raw query strings, or arbitrary unmatched request paths. - Configurable format/filter/query verbosity and color behavior; support machine-readable output as an alternative to development output. - Cover rejected requests and failures as well as successful operations; avoid noisy successful readiness polling and SQL transaction/context plumbing by default. - Preserve authenticated request ID correspondence with response headers and transactional history. Acceptance: - Automated tests cover configuration errors, formatting, sensitive-data exclusion, correlation, and request/query capture. - Synthetic PostgreSQL acceptance demonstrates standalone server logs for actual requests/queries; formatting, strict Clippy, and full tests pass. - Document controls and limitations in repository-native documentation. No production services or existing-port changes. Implemented and verified: - Central logging module with strict environment configuration: readable dev or JSON, independent SQL off/queries/all, application RUST_LOG filter, terminal color/NO_COLOR, slow-query threshold. Output goes to stderr with UTC timestamps. - Outer request middleware covers authentication rejections, fallbacks, failures, and health checks. Server-generated IDs correspond to response headers and mutation history; successful health polling stays silent. Application SQL counts and timings remain available when query lines are hidden. - SQLx query adapter logs bounded single-line SQL shapes, never bound values; masks literals/quoted identifiers/comments/dollar-quoted bodies and suppresses raw driver diagnostics. Default mode omits transaction/context/setup noise. Request logging uses route templates, not raw URLs, bodies, headers, or query strings. - Formatting/redaction/configuration/filter/color/health tests plus a standalone global-logger acceptance test against a fresh synthetic PostgreSQL database. The standalone test exercises dev, JSON, SQL-off, concurrent requests, denied/unmatched requests, real SQL timing/counts, and history correlation. Isolated processes avoid intermittent SQLx capture under scoped subscribers sharing the parallel test process. - Cargo formatting, strict all-target/all-feature Clippy, ordinary tests, all 23 tests through the synthetic helper, three repeated parallel PostgreSQL suite runs, Python syntax checks, and a visually inspected standalone dev log preview pass. Spawned test/preview servers were stopped; no commits or production changes. - README documents configuration and boundaries. Completion timing ends at response headers; SQL timing is driver-observed and excludes plumbing/trigger-internal statements. Redaction is defensive, not permission to interpolate data or put secrets in free-form messages.
Checklist
0 of 0 completeNo checklist items.