
Nothing in the project records what each request asked for or how long it took, so operations has no timing or identity in the logs. Write the middleware that times the downstream handling and logs one structured entry per request while passing every response through untouched.
Read the full problemDuring releases the site should return a maintenance response, except for staff who need to verify the deploy. Write the middleware that short-circuits with the defined 503 before the view runs, exempting staff users and the allowlisted paths.
Read the full problemUnhandled view errors answer with a raw 500 that carries no trace id, and a request has nothing tying its log lines together. Write a middleware that stamps every request with an id and turns an unhandled view exception into the defined JSON error response carrying it, then register it in the right place in the stack.
Read the full problemThe app needs one coherent request pipeline - identity, timing, maintenance gating, and error conversion working together in the right order - and currently has none of it. Write the layers that assign a request id, log one timed entry carrying it, gate general traffic with the defined 503 while staff pass, and convert an unhandled view exception into the defined error response, then register them so every concern sees what it must.
Read the full problem