Log the rest of the request log's fields (closes #79)
check / check (push) Successful in 3m45s

Each request log line now has the fields "Request log" in SPEC.md lists
whose features are built: instance (SWWAF_INSTANCE_NAME), scheme,
request_id (a trusted proxy's X-Request-ID or a new one, sent on to the
app), forwarded_for, client_group, content_type, content_length, the
headers SWWAF_LOG_REQUEST_HEADERS names, has_authorization, has_cookie,
websocket, response_content_type, cache_control, location, counts,
duration_checks, duration_upstream_connect and
duration_upstream_first_byte. A field that does not apply is left out.
Authorization, Cookie and Set-Cookie values are never logged.

Deviation: counts has request totals only; byte totals come with the byte limits.
Deviation: SWWAF_INSTANCE_NAME is on request lines only, not yet on process lines or metrics.
Judgement call: the headers go under request_headers, a name SPEC.md does not give.

Model: opus-5-5
This commit is contained in:
2026-10-06 11:54:56 +00:00
parent cff385af41
commit f61d821215
15 changed files with 818 additions and 120 deletions
+2
View File
@@ -169,6 +169,8 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
defer rq.addToHistory()
refused := rq.check(r.Context())
rq.checked = time.Now()
if refused != nil {
rq.answer(*refused)