Add access-log

This commit is contained in:
Ilja Neumann authored and Phil Davis committed 2020-11-19 09:05:24 +05:45
1 parent fe8586643f
commit c2aa4b02de
2 files changed
+14 -2

No files matched your search

+9 -2
View File
@@ -117,13 +117,20 @@ func (p *MultiHostReverseProxy) directorSelectionDirector(r *http.Request) {
}
for endpoint := range p.Directors[pol][rt] {
if handler(endpoint, *r.URL) {
p.logger.
Debug().
p.logger.Debug().
Str("policy", pol).
Str("prefix", endpoint).
Str("path", r.URL.Path).
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.Directors[pol][rt][endpoint](r)
return
}