From de1428e8ca2c6f0517618979e519af95056fbade Mon Sep 17 00:00:00 2001 From: bingoo Date: Wed, 27 May 2020 23:16:17 +0800 Subject: [PATCH] only log response JSON when httpStatus >= 400 --- weed/server/common.go | 6 ++++-- weed/server/volume_server_handlers.go | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/server/common.go b/weed/server/common.go index a2a4ea20b..150b9d954 100644 --- a/weed/server/common.go +++ b/weed/server/common.go @@ -47,8 +47,10 @@ func writeJson(w http.ResponseWriter, r *http.Request, httpStatus int, obj inter return } - glog.V(0).Infof("response method:%s URL:%s with httpStatus:%d and JSON:%s", - r.Method, r.URL.String(), httpStatus, string(bytes)) + if httpStatus >= 400 { + glog.V(0).Infof("response method:%s URL:%s with httpStatus:%d and JSON:%s", + r.Method, r.URL.String(), httpStatus, string(bytes)) + } callback := r.FormValue("callback") if callback == "" { diff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.go index 69662265b..14ad27d42 100644 --- a/weed/server/volume_server_handlers.go +++ b/weed/server/volume_server_handlers.go @@ -25,8 +25,6 @@ security settings: */ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Request) { - glog.V(0).Infof("request method:%s URL:%s", r.Method, r.URL.String()) - switch r.Method { case "GET", "HEAD": stats.ReadRequest()