use zap for logging (#1112)

Use zap for logging
This commit is contained in:
Jon Carl
2019-03-14 21:11:15 +05:30
committed by Vishal
parent c717f182b6
commit 0fc864f230
98 changed files with 2031 additions and 1223 deletions
+5 -4
View File
@@ -18,19 +18,20 @@ package controller
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"net/url"
"go.uber.org/zap"
)
func (api *API) StorageServiceProxy(w http.ResponseWriter, r *http.Request) {
u := api.storageServiceUrl
ssUrl, err := url.Parse(u)
if err != nil {
msg := fmt.Sprintf("Error parsing url %v: %v", u, err)
log.Println(msg)
http.Error(w, msg, http.StatusInternalServerError)
e := "error parsing url"
api.logger.Error(e, zap.Error(err), zap.String("url", u))
http.Error(w, fmt.Sprintf("%s %s: %v", e, u, err), http.StatusInternalServerError)
return
}
director := func(req *http.Request) {