Skip to content

Log one structured line per HTTP request - #6

Merged
reoring merged 2 commits into
mainfrom
work/20261119/requestlog
Nov 18, 2026
Merged

reoring merged 2 commits into
mainfrom
work/20261119/requestlog

Conversation

@reoring

@reoring reoring commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Why

Built-in apps emit no access log and hide most failures: after container log collection was enabled on Craftsman (2026-11-18), opening the production Builder Console produced zero lines. Tracking issue: APT-1314.

What

  • Wrap the server handler once with requestlog.Wrap from appserver-go (requestlog: one structured line per HTTP request appserver-go#9): one JSON line per request with method, path, route, status, bytes, duration and request id. No query strings, headers or bodies. Successful /healthz and /readyz are not logged.
  • Record failures that only wrote a response (and failures after the status line) with a fixed outcome/reason code.
  • Response bodies, status codes and existing diagnostics are unchanged.

Draft until

appserver-go v0.7.0 is tagged. go.mod currently pins the PR commit (5f8bf82); it will be replaced with v0.7.0 before this leaves draft.

Verification (local)

go vet ./... and go test ./... -count=1 against a disposable Postgres, no skipped tests. One failure, TestDatabaseFallbackAndSeed, also fails on main.

Wrap the server handler with appserver-go requestlog and record the
failures that only wrote a response. (appserver-go pinned to the PR
commit until v0.7.0 is tagged.)
@reoring
reoring marked this pull request as ready for review November 18, 2026 23:17
@reoring
reoring merged commit e3ffa7e into main Nov 18, 2026
3 checks passed
@reoring
reoring deleted the work/20261119/requestlog branch November 18, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant