如何从 python 日志记录模块存储 azure 函数应用程序日志?

how to store azure function app logs from python logging module?

我正在 Azure 上进行首次项目。我们创建了用 python.

编写的 Azure Functions 应用程序

我想知道如何将我的应用程序日志存储在 blob 存储中。澄清一下,我指的是我使用 python 的日志记录模块在代码中编写的日志,而不是 Azure 自动收集的日志.特别是,我想将 我在日志流 中看到的相同(实时)日志存储到一些 blob 存储中。

提前致谢!!

谢谢PierreLucGiguere-5297。将您的建议作为答案发布以帮助其他社区成员。

  • Azure Functions 提供与 Azure Monitor Logs 的集成以监视函数。您可以配置 Azure Functions 以将系统生成的和用户生成的日志发送到 Azure Monitor Logs。

  • 您可以将其存档到“存储帐户”,而不是将其发送到“日志分析”。为此,您需要一个适用于 Azure Storage.

    的客户端工具

可以参考How to send Azure Function App logs to Blob Storage?, Azure Functions Python developer guide and Azure Blob storage bindings for Azure Functions overview