def logmaker():
    path = os.path.dirname(os.path.realpath(__file__))
path = os.path.join(path, 'bot.log')
return logging.FileHandler(path)

def main():
    path = os.path.dirname(os.path.realpath(__file__))
loggingConf = open('{0}/logging.yml'.format(path), 'r')
logging.config.dictConfig(yaml.load(loggingConf))
loggingConf.close()
logger = logging.getLogger('cloaked_chatter')
logger.debug('Hello, world!')
if __name__ == '__main__':
    main()
How to specify in YAML to always create log file in the project's folder using dictConfig?