hook up tornado app logging
"""The builderhub application"""
+import logging
import os
import tornado.ioloop
+import tornado.options
+import tornado.log
import tornado.web
from traitlets import Unicode, Integer, Bool
from traitlets.config import Application
@@ -111,6 +114,10 @@ class BuilderHub(Application):
"""Load configuration settings."""
super().initialize(*args, **kwargs)
self.load_config_file(self.config_file)
+ # hook up tornado logging
+ tornado.options.logging = logging.getLevelName(self.log_level)
+ tornado.log.enable_pretty_logging()
+ self.log = tornado.log.app_log
self.tornado_settings = {
"docker_push_secret": self.docker_push_secret,
@@ -130,6 +137,7 @@ class BuilderHub(Application):
], **self.tornado_settings)
def start(self):
+ self.log.info("BuilderHub starting on port %i", self.port)
self.tornado_app.listen(self.port)
tornado.ioloop.IOLoop.current().start()
