##// END OF EJS Templates
hook up tornado 3's loggers to our handlers
MinRK -
Show More
@@ -316,6 +316,10 b' class NotebookApp(BaseIPythonApplication):'
316 def _log_level_default(self):
316 def _log_level_default(self):
317 return logging.INFO
317 return logging.INFO
318
318
319 def _log_format_default(self):
320 """override default log format to include time"""
321 return u"%(asctime)s.%(msecs).03d [%(name)s] %(message)s"
322
319 # create requested profiles by default, if they don't exist:
323 # create requested profiles by default, if they don't exist:
320 auto_create = Bool(True)
324 auto_create = Bool(True)
321
325
@@ -527,6 +531,14 b' class NotebookApp(BaseIPythonApplication):'
527 # self.log is a child of. The logging module dipatches log messages to a log
531 # self.log is a child of. The logging module dipatches log messages to a log
528 # and all of its ancenstors until propagate is set to False.
532 # and all of its ancenstors until propagate is set to False.
529 self.log.propagate = False
533 self.log.propagate = False
534
535 # set the date format
536 formatter = logging.Formatter(self.log_format, datefmt="%Y-%m-%d %H:%M:%S")
537 self.log.handlers[0].setFormatter(formatter)
538
539 # hook up tornado 3's loggers to our app handlers
540 for name in ('access', 'application', 'general'):
541 logging.getLogger('tornado.%s' % name).handlers = self.log.handlers
530
542
531 def init_webapp(self):
543 def init_webapp(self):
532 """initialize tornado webapp and httpserver"""
544 """initialize tornado webapp and httpserver"""
@@ -679,7 +691,7 b' class NotebookApp(BaseIPythonApplication):'
679 return mgr_info +"The IPython Notebook is running at: %s" % self._url
691 return mgr_info +"The IPython Notebook is running at: %s" % self._url
680
692
681 def start(self):
693 def start(self):
682 """ Start the IPython Notebok server app, after initialization
694 """ Start the IPython Notebook server app, after initialization
683
695
684 This method takes no arguments so all configuration and initialization
696 This method takes no arguments so all configuration and initialization
685 must be done prior to calling this method."""
697 must be done prior to calling this method."""
General Comments 0
You need to be logged in to leave comments. Login now