Merge pull request #72586 from dims/revert-generate-stack-traces-for-http-response

Revert "Generate Stack Traces for http response with status code zero"
pull/564/head
Kubernetes Prow Robot 2019-01-05 12:48:54 -08:00 committed by GitHub
commit 76e9089d0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 12 deletions

View File

@ -25,17 +25,6 @@ import (
"k8s.io/apiserver/pkg/server/httplog"
)
func badHTTPResponse() httplog.StacktracePred {
return func(status int) bool {
// http status code should not be zero
if status == 0 {
klog.Errorf("Bad HTTP Response - status is zero")
return true
}
return false
}
}
// WithPanicRecovery wraps an http Handler to recover and log panics.
func WithPanicRecovery(handler http.Handler) http.Handler {
return withPanicRecovery(handler, func(w http.ResponseWriter, req *http.Request, err interface{}) {
@ -50,7 +39,7 @@ func withPanicRecovery(handler http.Handler, crashHandler func(http.ResponseWrit
crashHandler(w, req, err)
})
logger := httplog.NewLogged(req, &w).StacktraceWhen(badHTTPResponse())
logger := httplog.NewLogged(req, &w)
defer logger.Log()
// Dispatch to the internal handler