title: Python logging and rotating files
body: <p>I have a python program that is writing to a log file that is being rotated by Linux's logrotate command.  When this happens I need to signal my program to stop writing to the old file and start writing to the new one.  I can handle the signal but how do I tell python to write to the new file?</p>
  
  <p>I am opening the file like this:</p>
  
  <pre><code>logging.basicConfig(format='%(asctime)s:%(filename)s:%(levelname)s:%(message)s',filename=log_file, level=logging.INFO)
  </code></pre>
  
  <p>and writing to it like this:</p>
  
  <pre><code>logging.log(level,"%s" % (msg))
  </code></pre>
  
  <p>The logging modules look very powerful but also overwhelming.  Thanks.</p>