Added handler for uncaught exceptions to make sure those get logged
This commit is contained in:
parent
827ea36d72
commit
977cf3c383
1 changed files with 5 additions and 0 deletions
|
|
@ -216,6 +216,8 @@ class Server():
|
|||
from tornado.ioloop import IOLoop
|
||||
from tornado.web import Application
|
||||
|
||||
import sys
|
||||
|
||||
debug = self._debug
|
||||
|
||||
# first initialize the settings singleton and make sure it uses given configfile and basedir if available
|
||||
|
|
@ -224,6 +226,9 @@ class Server():
|
|||
# then initialize logging
|
||||
self._initLogging(self._debug, self._logConf)
|
||||
logger = logging.getLogger(__name__)
|
||||
def exception_logger(exc_type, exc_value, exc_tb):
|
||||
logger.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_tb))
|
||||
sys.excepthook = exception_logger
|
||||
logger.info("Starting OctoPrint %s" % DISPLAY_VERSION)
|
||||
|
||||
# then initialize the plugin manager
|
||||
|
|
|
|||
Loading…
Reference in a new issue