title: Python: Configure logger with yaml to open logfile in write mode
body: <p>I have the following configuration of a logger in a the file loggingConfig.yml</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: DEBUG
      formatter: simple
      stream: ext://sys.stdout
  
  file_handler:
      class: logging.FileHandler
      level: INFO
      formatter: simple
      filename: info.log
      encoding: utf8
  
  loggers:
      my_module:
          level: ERROR
          handlers: [console]
          propagate: no
  
  root:
       level: INFO
       handlers: [console, file_handler]
  </code></pre>
  
  <p>And the following python code:</p>
  
  <pre><code>import logging
  import logging.config
  import yaml
  
  with open('loggingConfig.yml', 'rt') as f:
      config = yaml.safe_load(f.read())
      logging.config.dictConfig(config)
  
  logger = logging.getLogger(__name__)
  
  logger.info('TestLogger')
  </code></pre>
  
  <p>This works fine, but now I would like to open the logfile in write mode and not in append mode.
  I wasn't able to find any example which use a yaml file and opens the logfile in write mode.</p>
  
  <p>I only found, that open in write mode can be done using the fileConfig</p>
  
  <pre><code>logging.config.fileConfig('logging.conf')
  </code></pre>
  
  <p>and specify args in the logging.conf file:</p>
  
  <pre><code>args=('info.log', 'w')
  </code></pre>
  
  <p>Is there any way how I can do this using the yaml file or manipulating the config in the sourcecode?</p>