##// 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 316 def _log_level_default(self):
317 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 323 # create requested profiles by default, if they don't exist:
320 324 auto_create = Bool(True)
321 325
@@ -528,6 +532,14 b' class NotebookApp(BaseIPythonApplication):'
528 532 # and all of its ancenstors until propagate is set to False.
529 533 self.log.propagate = False
530 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
542
531 543 def init_webapp(self):
532 544 """initialize tornado webapp and httpserver"""
533 545 self.web_app = NotebookWebApplication(
@@ -679,7 +691,7 b' class NotebookApp(BaseIPythonApplication):'
679 691 return mgr_info +"The IPython Notebook is running at: %s" % self._url
680 692
681 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 696 This method takes no arguments so all configuration and initialization
685 697 must be done prior to calling this method."""
General Comments 0
You need to be logged in to leave comments. Login now