title: How to log to file and console at the same time with logging?
body: <p>I need to log data to file and also to console. I setup it like this:</p>
  
  <pre><code># set up logging
  logging.basicConfig(level    = logging.INFO,
                      format   ='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
                      datefmt  ='%Y-%m-%d %H:%M:%S',
                      handlers=[logging.FileHandler(dir + '/log.log'), logging.StreamHandler()]
                      )
  </code></pre>
  
  <p>Then i add data like this: <code>logging.info('Server started')</code>. In console i see the text, but file is empty. If I delete tgis file python creates new one, but still it is empty.</p>