title: How to specify in YAML to always create log file in the project's folder using dictConfig?
body: <p>In my Python program I have the following code:</p>
  
  <pre><code>def main():
      # The file's path
      path = os.path.dirname(os.path.realpath(__file__))
      ...
      # Config file relative to this file
      loggingConf = open('{0}/configs/logging.yml'.format(path), 'r')
      logging.config.dictConfig(yaml.load(loggingConf))
      loggingConf.close()
      logger = logging.getLogger(LOGGER)
      ...
  </code></pre>
  
  <p>and this is my logging.yml configuration file:</p>
  
  <pre><code>version: 1
  formatters:
    default:
      format: '%(asctime)s %(levelname)s %(name)s %(message)s'
  handlers:
    console:
      class: logging.StreamHandler
      level: DEBUG
      formatter: default
      stream: ext://sys.stdout
    file:
      class : logging.FileHandler
      formatter: default
      filename: bot.log
  loggers:
    cloaked_chatter:
      level: DEBUG
      handlers: [console, file]
      propagate: no
  </code></pre>
  
  <p>The problem is that the bot.log file is created where the program is launched. I want it to always be created in the project's folder, i.e. in the same folder as my Python program.</p>
  
  <p>For an example, launching the program with <code>./bot.py</code> would create the log file in the same folder. But launching it with <code>python3 path/bot.py</code> would create the log file a level above the Python program in the file hierarchy.</p>
  
  <p>How should I write the filename in the config file to solve this? Or do I need to write a custom handler? If so, how? Or is this not possible to solve using dictConfig?</p>