feat: make the app observable #28

Open
me wants to merge 6 commits from feature/observability into main
Owner

json.log had 1,248 lines in it and exactly two distinct events: request_started and request_finished. Nothing the app actually does was ever logged — three logger calls in the whole backend, none in the frontend.

This fixes twelve findings from an audit of that. The author's email is no longer f-stringed into vault notification logs. Login failures get logged instead of vanishing into a bare except, so a wrong password and a dead database no longer look identical. Config nothing used is gone: letters.log had been 0 bytes since it was created, flat_line.log was a copy of json.log, django.core.mail at DEBUG was silent. Requests now carry a duration and an X-Request-ID the frontend displays, so a bug report can be traced to a log line. The frontend gets a reporter, an ErrorBoundary and global handlers, having previously had nowhere to put an error except the reader's screen. And /api/health/ exists, with the compose healthchecks switched back on.

Backend 25 tests, frontend 81, ruff/biome/tsc clean. Also checked against a running server, not just in tests.

Five findings are left out because they need a decision rather than a patch: the log event names belong in CONTEXT.md first, IP logging deserves an ADR, and the log files still don't rotate or survive a redeploy. Tickets are in .scratch/observability/.

Audit: https://claude.ai/code/artifact/8dc7cf3b-dc1e-4b2c-91cc-f4b87b6d9aeb

`json.log` had 1,248 lines in it and exactly two distinct events: `request_started` and `request_finished`. Nothing the app actually does was ever logged — three logger calls in the whole backend, none in the frontend. This fixes twelve findings from an audit of that. The author's email is no longer f-stringed into vault notification logs. Login failures get logged instead of vanishing into a bare `except`, so a wrong password and a dead database no longer look identical. Config nothing used is gone: `letters.log` had been 0 bytes since it was created, `flat_line.log` was a copy of `json.log`, `django.core.mail` at DEBUG was silent. Requests now carry a duration and an `X-Request-ID` the frontend displays, so a bug report can be traced to a log line. The frontend gets a reporter, an ErrorBoundary and global handlers, having previously had nowhere to put an error except the reader's screen. And `/api/health/` exists, with the compose healthchecks switched back on. Backend 25 tests, frontend 81, ruff/biome/tsc clean. Also checked against a running server, not just in tests. Five findings are left out because they need a decision rather than a patch: the log event names belong in `CONTEXT.md` first, IP logging deserves an ADR, and the log files still don't rotate or survive a redeploy. Tickets are in `.scratch/observability/`. Audit: https://claude.ai/code/artifact/8dc7cf3b-dc1e-4b2c-91cc-f4b87b6d9aeb
me added 10 commits 2026-08-31 07:45:12 +00:00
me force-pushed feature/observability from 263f6744a1
Some checks failed
CI / Frontend CI (pull_request) Successful in 3m31s
CI / Backend CI (pull_request) Successful in 56s
CI / E2E Tests (pull_request) Has been cancelled
to 91779ab7a5
All checks were successful
CI / Frontend CI (pull_request) Successful in 3m26s
CI / Backend CI (pull_request) Successful in 52s
CI / E2E Tests (pull_request) Successful in 6m5s
2026-08-31 07:49:55 +00:00
Compare
me force-pushed feature/observability from 91779ab7a5
All checks were successful
CI / Frontend CI (pull_request) Successful in 3m26s
CI / Backend CI (pull_request) Successful in 52s
CI / E2E Tests (pull_request) Successful in 6m5s
to 5859fb3751
All checks were successful
CI / Frontend CI (pull_request) Successful in 3m24s
CI / Backend CI (pull_request) Successful in 53s
CI / E2E Tests (pull_request) Successful in 5m33s
2026-08-31 11:04:33 +00:00
Compare
All checks were successful
CI / Frontend CI (pull_request) Successful in 3m24s
CI / Backend CI (pull_request) Successful in 53s
CI / E2E Tests (pull_request) Successful in 5m33s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/observability:feature/observability
git switch feature/observability

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feature/observability
git switch feature/observability
git rebase main
git switch main
git merge --ff-only feature/observability
git switch feature/observability
git rebase main
git switch main
git merge --no-ff feature/observability
git switch main
git merge --squash feature/observability
git switch main
git merge --ff-only feature/observability
git switch main
git merge feature/observability
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
me/pi-ku!28
No description provided.