Python logging file config KeyError: 'formatters'

后端 未结 4 1738
生来不讨喜
生来不讨喜 2021-02-02 08:45

I\'m currently working on a python project and I set up logging using a config file. It has already worked and was logging my messages as wanted.

But then, after rearran

4条回答
  •  臣服心动
    2021-02-02 09:10

    Try to replace

    logging.config.fileConfig('../logging.conf', disable_existing_loggers=False)
    

    with this

    logging.config.fileConfig('logging.conf', disable_existing_loggers=False)
    

    Not sure, but probably your logging.conf is in your current working directory, and with the .. the file cannot be found.

提交回复
热议问题