Skip to content

Commit

Permalink
Add access-log
Browse files Browse the repository at this point in the history
  • Loading branch information
IljaN committed Nov 18, 2020
1 parent 37b8f3a commit 698adbd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions proxy/pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 698adbd

Please sign in to comment.