def main(settings):

    if os.path.isfile('logging.conf'):
        logging.config.fileConfig('logging.conf')

    ctx = zmq.Context()
    io_loop = IOLoop.instance()

    log_sub = ctx.socket(zmq.SUB)
    log_sub.setsockopt(zmq.SUBSCRIBE, "")
    log_sub.bind(settings.ZEROMQ_LOGGING)

    log_stream = ZMQStream(log_sub, io_loop)

    log_stream.on_recv(log_zmq_message)

    def handle_shutdown_signal(_sig, _frame):
        """
        Called from the os when a shutdown signal is fired.
        """
        log_stream.stop_on_recv()
        log_stream.flush()
        io_loop.stop()

    # handle kill signals
    signal.signal(signal.SIGINT, handle_shutdown_signal)
    signal.signal(signal.SIGTERM, handle_shutdown_signal)

    try:
        io_loop.start()
    except ZMQError:
        LOGGERS['master'].debug("Caught a ZMQError. Hopefully during shutdown")
        LOGGERS['master'].debug(traceback.format_exc())

    log_stream.close()
    ctx.term()
Add a user's server to the proxy table.
dataset/ETHPy150Open retresco/Spyder/src/spyder/logsink.py/main--crossover with--dataset/ETHPy150Open jupyterhub/jupyterhub/jupyterhub/orm.py/Proxy.add_user