Commit 7c371ee3 authored by Masahiro Sano's avatar Masahiro Sano

lower log level on recovering from panic

parent 159a58dd
...@@ -113,7 +113,7 @@ func RecoverPanics(handler http.Handler) http.Handler { ...@@ -113,7 +113,7 @@ func RecoverPanics(handler http.Handler) http.Handler {
defer func() { defer func() {
if x := recover(); x != nil { if x := recover(); x != nil {
http.Error(w, "apis panic. Look in log for details.", http.StatusInternalServerError) http.Error(w, "apis panic. Look in log for details.", http.StatusInternalServerError)
glog.Infof("APIServer panic'd on %v %v: %v\n%s\n", req.Method, req.RequestURI, x, debug.Stack()) glog.Errorf("APIServer panic'd on %v %v: %v\n%s\n", req.Method, req.RequestURI, x, debug.Stack())
} }
}() }()
defer httplog.NewLogged(req, &w).StacktraceWhen( defer httplog.NewLogged(req, &w).StacktraceWhen(
......
...@@ -66,7 +66,7 @@ func logPanic(r interface{}) { ...@@ -66,7 +66,7 @@ func logPanic(r interface{}) {
} }
callers = callers + fmt.Sprintf("%v:%v\n", file, line) callers = callers + fmt.Sprintf("%v:%v\n", file, line)
} }
glog.Infof("Recovered from panic: %#v (%v)\n%v", r, r, callers) glog.Errorf("Recovered from panic: %#v (%v)\n%v", r, r, callers)
} }
// ErrorHandlers is a list of functions which will be invoked when an unreturnable // ErrorHandlers is a list of functions which will be invoked when an unreturnable
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment