【问题标题】:Python logging: change configuration without restart? [duplicate]Python日志记录:更改配置而不重新启动? [复制]
【发布时间】:2015-09-17 20:29:53
【问题描述】:

我正在使用 Python 日志记录模块并使用 YAML 文件来定义配置,然后按如下方式初始化日志记录:

with open(config_file_path, 'r') as f:
        config = yaml.load(f.read())
        logging.config.dictConfig(config)

有没有办法监视文件更改,以便日志模块自动获取新配置而无需重新启动应用程序?

【问题讨论】:

标签: python python-2.7


【解决方案1】:

您可以将您的记录器设置为listen for config changes on a socket

【讨论】:

    猜你喜欢
    • 2012-06-24
    • 1970-01-01
    • 2015-04-01
    • 1970-01-01
    • 2014-02-26
    • 2013-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多