obnoxious proxy logging

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2021-03-08 16:13:19 +00:00
parent 97754be003
commit bb7cfb5a87

View File

@@ -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
}