mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #142 from jjhuff/log_apiserver_panic
When the apiserver panics, log a stacktrace.
This commit is contained in:
commit
af6903d22b
@ -23,6 +23,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
@ -77,7 +78,7 @@ func (server *ApiServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
if x := recover(); x != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
fmt.Fprint(w, "apiserver panic. Look in log for details.")
|
||||
log.Printf("ApiServer panic'd: %#v\n", x)
|
||||
log.Printf("ApiServer panic'd: %#v\n%s\n", x, debug.Stack())
|
||||
}
|
||||
}()
|
||||
log.Printf("%s %s", req.Method, req.RequestURI)
|
||||
|
Loading…
Reference in New Issue
Block a user