mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-31 01:10:20 -06:00
Add access-log
This commit is contained in:
5
changelog/unreleased/proxy-access-log.md
Normal file
5
changelog/unreleased/proxy-access-log.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Enhancement: Create a proxy acess-log
|
||||
|
||||
Logs client access at the proxy
|
||||
|
||||
https://github.com/owncloud/ocis/pull/889
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user