title: logs of child logger get displayed twice
body: <p>I cannot achieve proper logging of my module using python's standard <code>logging</code>. Yet it's a very simple case.
  I have the following module hierarchy:</p>
  
  <pre><code>module\
    foo.py
    bar.py
  </code></pre>
  
  <p>I need to log from each of these modules with the following constraints:</p>
  
  <ol>
  <li>all logs >= <code>INFO</code> from <code>module.foo</code> to the console (because what this module does is important and user must be notified live)</li>
  <li>all logs from <code>module.*</code> into a file</li>
  <li>all logs >= <code>WARNING</code> from <code>module.*</code> to the console</li>
  </ol>
  
  <p>Here is the main code </p>
  
  <pre><code>import logging
  import logging.config
  import os
  import yaml
  
  def setup_logging():
      loadfrom = os.path.join(os.path.dirname(__file__), 'config.yml')
      # Load
      with open(loadfrom, 'rt') as f:
          config = yaml.safe_load(f.read())
      logging.config.dictConfig(config)
  
  setup_logging()
  
  foo = logging.getLogger('module.foo')
  bar = logging.getLogger('module.bar')
  
  foo.info('module.foo doing something')
  foo.debug('module.foo debug data')
  
  bar.info('module.bar doing something')
  bar.error('module.bar something bad happened')
  </code></pre>
  
  <p>Here is the config I'm using</p>
  
  <pre><code>version: 1
  disable_existing_loggers: False
  formatters:
      simple:
          format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
  
  handlers:
      console:
          class: logging.StreamHandler
          level: INFO
          formatter: simple
          stream: ext://sys.stdout
      file:
          class: logging.handlers.RotatingFileHandler
          level: DEBUG
          filename: 'log.log'
          formatter: simple
          encoding: utf8
  
  loggers:
    module:
      level: WARNING
      handlers: [console]
      propagate: yes
    module.foo:
      level: INFO
      handlers: [console]
      propagate: yes # If yes, gets displayed twice. If false, entry is missing in log file
  root:
      level: DEBUG
      handlers: [file]
  </code></pre>
  
  <p>And here is the output :</p>
  
  <pre><code>2017-09-21 10:48:39,679 - module.foo - INFO - module.foo doing something
  2017-09-21 10:48:39,679 - module.foo - INFO - module.foo doing something
  2017-09-21 10:48:39,681 - module.bar - ERROR - module.bar something bad happened
  </code></pre>
  
  <p>The <code>log.info</code> from the child module gets displayed twice, because <code>propagate</code> field is set to yes in the config.
  Setting it to false solves the issue in the console but breaks the log file because the entry is missing in it.</p>
  
  <p>How can I solve this ? Any alternatives to the standard library that I personnally find counterintuitive ?</p>
  
  <h1>EDIT 1</h1>
  
  <p>New config after @wmorell's answer:</p>
  
  <pre><code>handlers:
      console:
          class: logging.StreamHandler
          level: INFO
          formatter: simple
          stream: ext://sys.stdout
      file:
          class: logging.handlers.RotatingFileHandler
          level: DEBUG
          filename: 'log.log'
          formatter: simple
          encoding: utf8
  
  loggers:
    module:
      level: WARNING
      handlers: [console]
      propagate: yes
    module.foo:
      level: DEBUG    &lt;- set this to debug
      handlers: [file, console] &lt;- Add file here
      propagate: false
  root:
      level: DEBUG
      handlers: [file]
  </code></pre>
  
  <p>Console output is OK:</p>
  
  <pre><code>2017-09-21 11:14:51,174 - module.foo - INFO - module.foo doing something
  2017-09-21 11:14:51,174 - module.bar - ERROR - module.bar something bad happened
  </code></pre>
  
  <p>Log output is not ok, misses the call to <code>log.info('module.bar')</code>:</p>
  
  <pre><code>2017-09-21 11:18:34,335 - module.foo - INFO - module.foo doing something
  2017-09-21 11:18:34,335 - module.foo - DEBUG - module.foo debug data
  2017-09-21 11:18:34,335 - module.bar - ERROR - module.bar something bad happened
  </code></pre>