summaryrefslogtreecommitdiffstats
path: root/app/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/server.go')
-rw-r--r--app/server.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/app/server.go b/app/server.go
index a757e184e..0b45de092 100644
--- a/app/server.go
+++ b/app/server.go
@@ -13,13 +13,14 @@ import (
l4g "github.com/alecthomas/log4go"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
- "github.com/mattermost/platform/model"
- "github.com/mattermost/platform/store"
- "github.com/mattermost/platform/utils"
"github.com/rsc/letsencrypt"
"github.com/tylerb/graceful"
"gopkg.in/throttled/throttled.v2"
"gopkg.in/throttled/throttled.v2/store/memstore"
+
+ "github.com/mattermost/platform/model"
+ "github.com/mattermost/platform/store"
+ "github.com/mattermost/platform/utils"
)
type Server struct {
@@ -38,6 +39,14 @@ var allowedMethods []string = []string{
"DELETE",
}
+type RecoveryLogger struct {
+}
+
+func (rl *RecoveryLogger) Println(i ...interface{}) {
+ l4g.Error("Please check the std error output for the stack trace")
+ l4g.Error(i)
+}
+
type CorsWrapper struct {
router *mux.Router
}
@@ -158,7 +167,7 @@ func StartServer() {
Timeout: TIME_TO_WAIT_FOR_CONNECTIONS_TO_CLOSE_ON_SERVER_SHUTDOWN,
Server: &http.Server{
Addr: utils.Cfg.ServiceSettings.ListenAddress,
- Handler: handlers.RecoveryHandler(handlers.PrintRecoveryStack(true))(handler),
+ Handler: handlers.RecoveryHandler(handlers.RecoveryLogger(&RecoveryLogger{}), handlers.PrintRecoveryStack(true))(handler),
ReadTimeout: time.Duration(*utils.Cfg.ServiceSettings.ReadTimeout) * time.Second,
WriteTimeout: time.Duration(*utils.Cfg.ServiceSettings.WriteTimeout) * time.Second,
},