title: Python logging module imported in different scripts
body: <p>In the python logging tutorial, there is an example with two python scripts : <code>myapp.py</code>, and <code>mylib.py</code></p>
  
  <p>The code is :</p>
  
  <pre><code># myapp.py
  import logging
  import mylib
  
  def main():
      logging.basicConfig(filename='myapp.log', level=logging.INFO)
      logging.info('Started')
      mylib.do_something()
      logging.info('Finished')
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>and</p>
  
  <pre><code># mylib.py
  import logging
  
  def do_something():
      logging.info('Doing something')
  </code></pre>
  
  <p>What I don't get is how the fact that using <code>basicConfig</code> in <code>myapp.py</code> changes the logging behavior in <code>mylib.py</code>.</p>
  
  <p>I thought that in Python, when you import the same module in two different scripts, they are completely disconnected because the first one becomes <code>myapp.logging</code> and the second one <code>mylib.logging</code>.</p>
  
  <p>EDIT :</p>
  
  <p>I changed mylib.py code to </p>
  
  <pre><code># mylib.py
  import logging
  
  
  def do_something():
      logging.warning('Doing something')
  
  
  do_something()
  </code></pre>
  
  <p>When I run myapp.py, the logs are now printed in the console and do not appear in the log file anymore. How is that possible?</p>