title: Write a header at every logfile that is created with a time-rotating logger
body: <p>I've made a time-rotating logger which creates a new logfile at midnight. In my logfile I want to write a header at the top of every file. I'm looking for an efficient way to call a function which writes this header to the logfile upon the moment that the file is created.</p>
  
  <pre><code>import logging
  from logging.handlers import TimedRotatingFileHandler
  
  # create time-rotating log handler
  logHandler = TimedRotatingFileHandler(logfile, when='midnight')
  
  # create logger
  self.log = logging.getLogger('MyTimeRotatingLogger')
  self.log.addHandler(logHandler)
  </code></pre>