title: Logging over multiple modules
body: <p>How can I log everything using Python 'logging' to 1 text file, over multiple modules?</p>
  
  <p><strong>Main.py</strong>:</p>
  
  <pre><code>import logging
  logging.basicConfig(format='localhost - - [%(asctime)s] %(message)s', level=logging.DEBUG)
  log_handler = logging.handlers.RotatingFileHandler('debug.out', maxBytes=2048576)
  
  
  log = logging.getLogger('logger')
  log.addHandler(log_handler)
  
  import test
  </code></pre>
  
  <p><strong>Test.py</strong>:</p>
  
  <pre><code>import logging
  
  log = logging.getLogger('logger')
  log.error('test')
  </code></pre>
  
  <p>debug.out stays empty. I'm not sure what to try next, even after reading the logging documentation.</p>
  
  <p><strong>Edit</strong>: Fixed with the code above.</p>