From f3b0b33dc506407b2af0bdd19c06195bcb8b4167 Mon Sep 17 00:00:00 2001 From: Daniel Hwang Date: Fri, 30 Apr 2021 16:39:15 -0700 Subject: [PATCH] debug: log host / path to help understand why the ingress rule logged is being selected. in addition, combine "Request Headers..." and "Serving with ingress..." logs into this updated log. Co-authored-by: Silver --- origin/proxy.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/origin/proxy.go b/origin/proxy.go index 95ffa0d9..6c192a1e 100644 --- a/origin/proxy.go +++ b/origin/proxy.go @@ -238,8 +238,13 @@ func (p *proxy) logRequest(r *http.Request, fields logFields) { } else { p.log.Debug().Msgf("All requests should have a CF-RAY header. Please open a support ticket with Cloudflare. %s %s %s ", r.Method, r.URL, r.Proto) } - p.log.Debug().Msgf("CF-RAY: %s Request Headers %+v", fields.cfRay, r.Header) - p.log.Debug().Msgf("CF-RAY: %s Serving with ingress rule %v", fields.cfRay, fields.rule) + p.log.Debug(). + Str("CF-RAY", fields.cfRay). + Fields(r.Header). + Str("host", r.Host). + Str("path", r.URL.Path). + Interface("rule", fields.rule). + Msg("Inbound request") if contentLen := r.ContentLength; contentLen == -1 { p.log.Debug().Msgf("CF-RAY: %s Request Content length unknown", fields.cfRay)