class_docstr: A monitor process for monitoring worker log files.
code: def run(self):
      try:
          while True:
              # Exit if we received a signal that we should stop.
              if self.thread_stopped.is_set():
                  return
              self.check_and_open_log_file()
              anything_published = (
                  self.check_log_file_and_publish_updates()
              )
              # If nothing was published, then wait a little bit to avoid using too much CPU.
              if not anything_published:
                  time.sleep(0.1)
      except Exception as e:
          self.socket.send_string(str(e))
          invalidInputError(False, str(e))
      finally:
          self.close_log_file()
  
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 5 for calling the LogMonitor obj's underlying member method code with example usage: obj.run() without return types