Add structured logging and error safety to API endpoints #14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
API errors (e.g. 500 on
mark-posted) are swallowed with no log output, making them invisible unless actively debugging with curl. There is no structured logging on any endpoint — failures disappear silently.What happened
POST /api/v1/opportunities/{id}/mark-postedreturned 500 due toNOT NULL constraint failed: posts.campaign_id. No log line was emitted. The only way to find the cause was direct DB inspection.Desired behaviour
logging(not print)~/.local/share/magpie/magpie.log(or configurable via env)manage.sh logstails the log fileAcceptance criteria
logging.basicConfigor equivalent)@app.exception_handlerlogs all 500s with tracebackmanage.sh logsworks and tails the right file