Documentation
¶
Overview ¶
Package reqlog logs a failure an HTTP handler met while serving a request (#2728).
A handler whose caller went away mid-request (a browser panning a map away, the tile renderer abandoning a page) sees its reads fail with the request's own context canceled. Nothing failed on the server: nobody was waiting for the answer any more. Logged at ERROR, those lines read as outages to every soak, alert and dashboard that counts ERROR, and hide the real failures that look the same. Failed logs them at DEBUG, and a failure met while the caller is still there at ERROR, in one place for every handler. .semgrep/go-request-error-log.yml refuses slog.ErrorContext on a request's context anywhere else.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallerGone ¶
CallerGone reports whether the request's caller stopped waiting: its context is done, or err is the cancellation that ended the read.
Types ¶
This section is empty.