Beispiel #1
0
 def _run(self, application, socket):
     """Start a WSGI server in a new green thread."""
     logger = logging.getLogger('eventlet.wsgi')
     eventlet.wsgi.server(socket,
                          application,
                          custom_pool=self.tg.pool,
                          log=logging.WritableLogger(logger))
Beispiel #2
0
    def run(self, run_once=False):
        LOG.debug(_('Starting qonos-api service'))
        # This must be done after the 'well-known' config options are loaded
        # so the list of action_overrides can be read
        self.register_action_override_cfg_opts()
        wsgi_logger = logging.getLogger('eventlet.wsgi.server')

        if CONF.api.daemonized:
            import daemon
            #NOTE(ameade): We need to preserve all open files for logging
            open_files = utils.get_qonos_open_file_log_handlers()
            with daemon.DaemonContext(files_preserve=open_files):
                wsgi.run_server(self.app, CONF.api.port,
                                log=logging.WritableLogger(wsgi_logger),
                                log_format=CONF.api.wsgi_log_format)
        else:
            wsgi.run_server(self.app, CONF.api.port,
                            log=logging.WritableLogger(wsgi_logger),
                            log_format=CONF.api.wsgi_log_format)
Beispiel #3
0
    def run(self, run_once=False):
        LOG.debug(_('Starting qonos-api service'))
        # This must be done after the 'well-known' config options are loaded
        # so the list of action_overrides can be read
        self.register_action_override_cfg_opts()
        wsgi_logger = logging.getLogger('eventlet.wsgi.server')

        wsgi.run_server(self.app,
                        CONF.api.port,
                        log=logging.WritableLogger(wsgi_logger),
                        log_format=CONF.api.wsgi_log_format)