title: python3: timedrotatingfilehandler log rotation issue with same log file with multiple scripts
body: <p>Please help in troubleshooting python3 logging from multiple processes into same log file.
  i have dameon main script, which runs in back ground, and calls few other pythons scripts every 15seconds, and each python script is written with same TimedRotatingFileHandler attributes, and all logs are written into same log file.</p>
  <p>everything works fine, except log rotation.</p>
  <pre><code>lib/
  ├── __init__.py
  ├── FIRST.py
  └── SECOND.py
  └── THIRD.py
  main_daemon.py
  </code></pre>
  <p>main python daemon file looks like</p>
  <pre><code>t1 = t2 = t3 = Thread()
  my_thread = MYthreads(t1, t2, t3)
  ################# Daemon Class #################
  class Daemon(Daemon):
          def run(self):
               while True:
                  my_thread.start_my_class()
                  time.sleep(15)
  
  ProcessManager = Daemon('daemon.pid')
  ProcessManager.start()
  </code></pre>
  <p><code>lib/__init__.py</code> file looks lile</p>
  <pre><code>class MYthreads:
      def __init__(self, t1, t2, t3):
          self.t1 = t1
          self.t2 = t2
          self.t3 = t3
  
      def start_my_class(self):
              for file in List_files(path1):
                  self.t1 = Thread(target=FIRSTprocess, args=(file,))
                  self.t1.start()
                  self.t1.join()
              for file in List_files(path2):
                  self.t2 = Thread(target=SECONDprocess, args=(file,))
                  self.t2.start()
                  self.t2.join()
              for file in List_files(path3):
                  self.t3 = Thread(target=THIRDprocess, args=(file,))
                  self.t3.start()
                  self.t3.join()
  </code></pre>
  <p>here the targets are functions imported from seperate python files in lib/ directory.
  each python files writes logs into same log file.</p>
  <p>logging defined in each python file inside lib/ directory..</p>
  <pre><code>logger = logging.getLogger('mylogger')
  #TimedRoatingFile handler definition
  Timed_formatter = logging.Formatter('%(message)s')
  Timed_handler = logging.handlers.TimedRotatingFileHandler('my_log', 'midnight', 1, 90)
  Timed_handler.setFormatter(Timed_formatter)
  logger.addHandler(Timed_handler)
  #syslog handler definition
  if syslog_streaming and curr_os != 'Windows':
      log_formatter = logging.Formatter('%(name)s: %(message)s')
      Sys_handler = logging.handlers.SysLogHandler(address = '/dev/log')
      Sys_handler.setFormatter(log_formatter)
      logger.addHandler(Sys_handler)
      logger.handlers = [logger.handlers[0], logger.handlers[1]]
  else:
      logger.handlers = [logger.handlers[0], ]
  # Set lev to DEBUG, applied to both
  logger.setLevel(logging.DEBUG)
  </code></pre>
  <p>So, i have defined same logging attributes in all python files, and writing them into same log file, and imported all those functions into <code>__init__.py</code> and calling class every 15seconds through while loop.</p>
  <p>Logging &amp; log writing is working fine.. and even syslogging is also working fine.</p>
  <p><strong>Problem:</strong>
  Log rotation is not working fine. i must use time rotating handler, since my requirement is to do rollover at 12AM every night.
  When i check log file after 12 AM, backup file is created, but logs written  whole day before 00hrs is lost, i could only few lines of logs generated at 00hours at new date, and older date logs are all LOST.</p>
  <pre><code>-rw-r--r--. 1 usertony usertony    1097 Sep  7 01:15 my_log.2020-09-06
  -rw-r--r--. 1 usertony usertony    1097 Sep  8 00:00 my_log.2020-09-07
  -rw-r--r--. 1 usertony usertony      96 Sep  9 00:00 my_log.2020-09-08
  </code></pre>