Write the backend's logs as the estate's log line (AHT-204) #47
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
javascript
question
queue
release:major
release:minor
release:none
release:patch
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/kill-me!47
Loading…
Reference in a new issue
No description provided.
Delete branch "aht-204-logline"
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?
Work package: AHT-204, one logging standard across at-home.
The backend's logs become the estate's one log line, the same way auth and chess-tactics moved.
requestLog()inbackend/log.jsreplaces it and writes onerequestline per request:method,path(no query string),statusandms, with a 5xx logged at error. morgan is gone from the dependencies.server.js(ready, startup failed, pending migrations),auth.js(get-session failed), the 24 route handlers in cardio, soreness and workouts, andself-check.js. Error stacks and upstream error text go througherrorText, which masks withredactand caps at 4 KiB. No session cookie, token or Authorization value is logged.migrations/apply.jsandmigrations/dry-run.js. Nelson runs these by hand (npm run migrate,npm run migrate:dry-run), and their output is a report for him to read in the terminal, not the service's log. The migrations that run at pod startup (migrations/runner.js) write no lines of their own.backend/.npmrcpoints to Forgejo's npm registry, and@romaine-life/loglineis pinned at 0.1.4. The Dockerfile copies.npmrcand mounts theFORGEJO_PACKAGES_TOKENBuildKit secret onnpm ci. The web-app and cluster-service suites pass that secret to the image build.backend/log.test.js(new) reads the lines back with logline'sparse. It covers absent fields, masking and the cap, and a real Express app with the soreness routes: one line per request, no query, and a 500 at error with its masked route-error line.Locally,
ci-checkpassed the backend and frontend checks. The conventions check could not run on this PC because it needs Python, so CI decides that one.🤖 Generated with Claude Code