def __init__(self): if hasattr(settings, 'BLUEOX_HOST'): if settings.BLUEOX_HOST: blueox.default_configure(settings.BLUEOX_HOST) else: blueox.configure(None, None) else: blueox.default_configure()
def __init__(self): host = getattr(settings, 'BLUEOX_HOST', '127.0.0.1') port = getattr(settings, 'BLUEOX_PORT', 3514) blueox.configure(host, port) handler = blueox.LogHandler() handler.setLevel(logging.INFO) logging.getLogger('').addHandler(handler)
def on_worker_process_init(**kwargs): if hasattr(settings, 'BLUEOX_HOST'): if settings.BLUEOX_HOST: blueox.default_configure(settings.BLUEOX_HOST) else: blueox.configure(None, None) else: blueox.default_configure()
def on_worker_process_init(**kwargs): host = getattr(settings, 'BLUEOX_HOST', '127.0.0.1') port = getattr(settings, 'BLUEOX_PORT', 3514) blueox.configure(host, port) handler = blueox.LogHandler() handler.setLevel(logging.INFO) logging.getLogger('').addHandler(handler)
with blueox.Context('request.extra'): blueox.set('continue_id', self.blueox.id) self.write("Hello, world") self.finish() application = tornado.web.Application([ (r"/", MainHandler), (r"/async", AsyncHandler), (r"/async_crash", AsyncCrashHandler), (r"/async2", ManualAsyncHandler), ]) def logit(ctx): pprint.pprint(ctx.to_dict()) if __name__ == "__main__": # Iniatialize the blue ox system. Providing a recorder function rather than a host and port # will allow us to receive the data right away rather than forwarding to an oxd instance. blueox.configure(None, None, recorder=logit) # Instruct tornado's autoreload to shutodwn blueox during reload. # Note: Since we're not actually using the network in this example, this # probably isn't strictly necessary. tornado.autoreload.add_reload_hook(blueox.shutdown) application.listen(8888) tornado.ioloop.IOLoop.instance().start()
def __init__(self): host = getattr(settings, 'BLUEOX_HOST', '127.0.0.1') port = getattr(settings, 'BLUEOX_PORT', 3514) blueox.configure(host, port)