code: def start_log_server(ip, port):
      def _print_logs():
          """
          Prints log messages from workers on all of the nodes.
  
          """
          import zmq
  
          with zmq.Context() as context:
              with context.socket(zmq.REP) as socket:
                  socket.bind("tcp://{}:{}".format(ip, port))
                  logger.info(
                      "started log server on {}:{}".format(ip, port)
                  )
  
                  while True:
                      message = socket.recv()
                      print(message.decode("utf-8"))
                      socket.send(b"received")
  
      import threading
  
      logger_thread = threading.Thread(
          target=_print_logs, name="print_logs"
      )
      logger_thread.daemon = True
      logger_thread.start()
      return logger_thread
  
file_path: BigDL/python/orca/src/bigdl/orca/learn/log_monitor.py
imports: import logging
  import os
  import time
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 1 for calling a global function with example usage: start_log_server(ip, port) and returns: logger_thread