【问题标题】:Greengrass v2 logging from within the component组件内的 Greengrass v2 日志记录
【发布时间】:2022-01-28 11:47:20
【问题描述】:

我看不到任何我可能会从 Greengrass v2 组件注销的内容。

例如:

import logging
...
...
logger = logging.getLogger()
logger.setLevel(logging.INFO)

...
...
logger.info("Hello world")

这在我的 .log 或 greengrass.log 文件中不可见。我也尝试过不同的日志记录级别。和logger.debug("...")

【问题讨论】:

    标签: aws-iot greengrass aws-iot-greengrass


    【解决方案1】:

    您是否使用-u 参数运行Python 来禁用输出缓冲?如果没有这个参数,Python 脚本可能不会输出日志。

    查看此故障排除条目:Python script doesn't log messages

    【讨论】:

      【解决方案2】:

      我最终将日志记录配置为:

      logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-10-22
        • 2017-04-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多