title: Create new log file for everyday using python logging
body: <p>My python code works fine to create a log file with name and date on which code was executed - </p>
  
  <p>For example-</p>
  
  <p>I run code today it will create log file - <code>logfile_2020-01-15.log</code></p>
  
  <p>I run code tomorrow it will create log file - <code>logfile_2020-01-16.log</code> and so on.</p>
  
  <p>Now the concern is, if my code execution is started today and it keeps on running for 8 days. It should create 8 log files - 1 file each day: <code>logfile_2020-01-15.log to logfile_2020-01-23.log</code> </p>
  
  <p>But this is not happening. It keeps on logging in same file: <code>logfile_2020-01-15.log</code> when the code was initiated.  </p>
  
  <p>Please can anyone help me modify code-</p>
  
  <pre><code>import datetime
  import logging
  import schedule
  class Workflow:    
  
      def setupLoggingToFile():
          logFilePath = "C:\ExceptionLogFiles\"
          logdate = datetime.datetime.now().strftime('%Y-%m-%d')
          logging.basicConfig(
              format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
              datefmt='%m-%d-%y %H:%M:%S',
              level=logging.DEBUG,
              handlers=[RotatingFileHandler(logFilePath + "logfile_"+logdate+".log",maxBytes=10485760, backupCount=100)])   
  
      def StartWorkflow(self):
          try:
              print("New Cron Cycle Started..")
          except Exception:
              logging.exception("Something went wrong.", exc_info=True)
  
      def StartCron(self):
          try:
              schedule.every(5).seconds.do(self.StartWorkflow)
              while 1:
                  schedule.run_pending()
                  time.sleep(1)
          except Exception:
              logging.debug("CRON was unable to start. Something Wrong in StartCron function.")
              logging.exception("CRON was unable to start. Something Wrong in StartCron function.", exc_info=True)
  
  
  A = Workflow()
  A.StartCron()
  </code></pre>