jina.logging.sseยถ

jina.logging.sse.start_sse_logger(log_config, log_id, flow_yaml=None)[source]ยถ

Start a logger that emits server-side event from the log queue, so that one can use a browser to monitor the logs

Parameters
  • log_config (Dict) โ€“ configuration of the sse server

  • log_id (str) โ€“ log-id of Flow

  • flow_yaml (Optional[str]) โ€“ Flow yaml description

Example:

var stream = new EventSource('http://localhost:5000/log/stream');
stream.onmessage = function (e) {
    console.info(e.data);
};
stream.onerror = function (err) {
    console.error("EventSource failed:", err);
    stream.close()
};