From bb7cfb5a87d82b78430b1004ab856274ba4befac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 8 Mar 2021 16:13:19 +0000 Subject: [PATCH] obnoxious proxy logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- proxy/pkg/proxy/proxy.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/proxy/pkg/proxy/proxy.go b/proxy/pkg/proxy/proxy.go index 7e1931a6a4..c5a4f29083 100644 --- a/proxy/pkg/proxy/proxy.go +++ b/proxy/pkg/proxy/proxy.go @@ -110,6 +110,10 @@ func NewMultiHostReverseProxy(opts ...Option) *MultiHostReverseProxy { } func (p *MultiHostReverseProxy) directorSelectionDirector(r *http.Request) { + p.logger.Info(). + Interface("request", r). + Msg("%%%%%%%%%%%%% DIRECTING %%%%%%%%%%%%%%%%") + pol, err := p.PolicySelector(r.Context(), r) if err != nil { p.logger.Error().Msgf("Error while selecting pol %v", err) @@ -146,12 +150,12 @@ func (p *MultiHostReverseProxy) directorSelectionDirector(r *http.Request) { Str("routeType", string(rt)). Msg("director found") - p.logger. - Info().Fields(map[string]interface{}{ - "method": r.Method, - "path": r.URL.Path, - "from": r.RemoteAddr, - }).Msg("access-log") + p.logger.Info(). + Str("method", r.Method). + Str("path", r.Method). + Str("from", r.RemoteAddr). + Msg("access-log") + p.Directors[pol][rt][endpoint](r) return }