Fix up logging

This commit is contained in:
Kegan Dougal 2017-04-20 11:53:42 +01:00
parent 060332587d
commit e3492942c4

View file

@ -56,8 +56,9 @@ func makeProxy(targetURL string) (*httputil.ReverseProxy, error) {
path := req.URL.Path path := req.URL.Path
path = "api" + path path = "api" + path
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"path": path, "path": path,
"url": targetURL, "url": targetURL,
"method": req.Method,
}).Print("proxying request") }).Print("proxying request")
newURL, err := url.Parse(targetURL + path) newURL, err := url.Parse(targetURL + path)
if err != nil { if err != nil {
@ -113,7 +114,7 @@ func main() {
fmt.Println("Proxying requests to:") fmt.Println("Proxying requests to:")
fmt.Println(" /_matrix/client/r0/sync => ", *syncServerURL+"/api/_matrix/client/r0/sync") fmt.Println(" /_matrix/client/r0/sync => ", *syncServerURL+"/api/_matrix/client/r0/sync")
fmt.Println(" /* => ", *clientAPIURL+"/api/*") fmt.Println(" /* => ", *clientAPIURL+"/api/*")
fmt.Println("Listening on %s", *bindAddress) fmt.Println("Listening on ", *bindAddress)
srv.ListenAndServe() srv.ListenAndServe()
} }