title: How to use .yaml file for logging specific level only
body: <p>I am dealing with the same problem as <a href="https://stackoverflow.com/q/8162419/1772898">python logging specific level only</a> &amp; <a href="https://stackoverflow.com/q/879732/1772898">logging with filters</a> the only exception being i am using an .yaml file.</p>
  <p>I checked the <a href="https://docs.python.org/3/library/logging.config.html" rel="nofollow noreferrer">documentation</a>, it says:</p>
  <blockquote>
  <p>The fileConfig() API is older than the dictConfig() API and does not
  provide functionality to cover certain aspects of logging. For
  example, you cannot configure Filter objects, which provide for
  filtering of messages beyond simple integer levels, using
  fileConfig(). If you need to have instances of Filter in your logging
  configuration, you will need to use dictConfig(). Note that future
  enhancements to configuration functionality will be added to
  dictConfig(), so it’s worth considering transitioning to this newer
  API when it’s convenient to do so.</p>
  </blockquote>
  <p>I have checked <a href="https://stackoverflow.com/q/21455515/1772898">install filter on logging level in python using dictConfig</a> and <a href="https://stackoverflow.com/q/7507825/1772898">Where is a complete example of logging.config.dictConfig?</a></p>
  <p>My latest python file looks like:</p>
  <pre><code>import logging
  import logging.config
  import yaml
  
  with open('logging.yaml', 'rt') as f:
      config = yaml.safe_load(f.read())
  logging.config.dictConfig(config)
  
  logger = logging.getLogger('module1')
  
  # 'application' code
  logger.debug('debug message')
  logger.info('info message')
  logger.warning('warn message')
  logger.error('error message')
  logger.critical('critical message')
  </code></pre>
  <p>The <code>logging.yaml</code> file looks like:</p>
  <pre><code>version: 1
  formatters:
     simple:
       format: '{asctime} : {name} : {levelname} : {message}'
       style: '{'
  handlers:
   console:
      class: logging.StreamHandler
      level: DEBUG
      formatter: simple
      stream: ext://sys.stdout
  loggers:
     module1:
       level: DEBUG
       handlers: [console]
       propogate: no
  root:
      level: DEBUG
      handlers: [console]
  </code></pre>
  <p>Not understanding how to modify <code>logging.yaml</code> file so that I can view only INFO in console and save CRITICAL, ERROR, WARNING to <code>logfile.log</code>.</p>