Write the backend's logs as the estate's log line (AHT-204) #99
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(the full path with no query string),statusandms.caller, the token kind morgan used to write ascaller="..."(home device=…,auth human sub=…,auth refused …), still in the line as CLAUDE.md describes, now masked.server.jsandroutes/app.jsbecome a level, a fixed message and fields. These are ready, self-test passed or failed, startup failed, tree read failed and tree save failed. The last two carry the tree id. Error stacks go througherrorText, which masks withredactand caps at 4 KiB. No token, cookie or Authorization value is logged.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 image is built by the cluster-service suite, which passes that secret, and runs on the home cluster.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/fztrouter: the full path, no query,caller, 404, and a 500 at error with its maskedtree read failedline.--self-testwas also run locally, and it writes only standard lines.🤖 Generated with Claude Code