Skip to content

Commit

Permalink
Merge pull request kubernetes#142 from jjhuff/log_apiserver_panic
Browse files Browse the repository at this point in the history
When the apiserver panics, log a stacktrace.
  • Loading branch information
brendandburns committed Jun 18, 2014
2 parents 0c68c63 + 3072ccf commit af6903d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"log"
"net/http"
"net/url"
"runtime/debug"
"strings"

"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit af6903d

Please sign in to comment.