Skip to content

Instantly share code, notes, and snippets.

@ehzawad
Created April 19, 2026 19:22
Show Gist options
  • Select an option

  • Save ehzawad/0678479263ffa05fee86ad7a2cb8363a to your computer and use it in GitHub Desktop.

Select an option

Save ehzawad/0678479263ffa05fee86ad7a2cb8363a to your computer and use it in GitHub Desktop.

I want to add a logging middleware to my FastAPI app. Log every request and
response with: method, path, status, latency, a correlation ID, and redact
auth headers. Structured JSON output. Before you write any code, ask codex
for a second opinion on the design — specifically: async vs sync middleware,
how to propagate the correlation ID through downstream async tasks, and
what the cleanest redaction point is. Then reconcile and implement.

https://github.com/ehzawad/codex-opinion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment