title: Python logging: Set handlers for all loggers of used modules
body: <p>I have my main script that interprets cli commands with argparse and then starts the application by calling the according stuff form an other module (made by myself).</p>
  
  <p>My question now is how I can attach a handler to the logger from that module. The logger is retrieved with</p>
  
  <pre><code>logger = logging.getLogger(__name__)
  </code></pre>
  
  <p>I hence put following in my main script:</p>
  
  <pre><code>consoleHandler = logging.StreamHandler()
  logger = logging.getLogger('MyModule')
  logger.addHandler(consoleHandler)
  </code></pre>
  
  <p>However there is 0 logging output from 'MyModule'. Log levels are correct, eg there should be an output.</p>
  
  <p>In <code>MyModule</code> I have the following:</p>
  
  <pre><code>logging.getLogger(__name__).addHandler(logging.NullHandler())
  </code></pre>
  
  <p>However removing that makes no difference.</p>
  
  <p>So how can I correctly attach a handler to the logger of <code>MyModule</code>?</p>