如何在 Azure log Analytics 上显示 azure app service 的 web 服务器日志?

How to display azure app service's web server log on Azure log Analytics?

我有一个 api 应用程序托管在 Azure 应用程序服务上。对于 Web 服务器日志(iis 日志),我从 Azure 门户打开了 Web 服务器日志记录。请看下面的屏幕截图。

用于存储网络服务器日志记录

服务器日志只允许存储在 Azure blob 容器中。根据配置,日志按预期存储在 blob 容器中。现在我想使用这些日志显示在 Azure Log Analytics 上。

我在 Azure Web 门户的 Log Analytics 上有以下存储配置。

在 Log Analytics 资源管理器上,我可以查看来自除 Web 服务器(iis 日志)以外的所有其他来源的日志。我在这里缺少什么?

Verified with App Services team Log Analytics 仅在 IaaS (VM) 级别受支持,不支持PaaS(应用服务)级别。

希望我们能尽快将其纳入他们的路线图 - 现在您必须手动将这些数据提取到外部日志管理工具中 (Splunk, Sumo Logic, Azure Data Explorer)。

2019 年 2 月 12 日更新

Azure 应用服务 已宣布 Public Preview for IIS App Log integration with Azure Log Analytics

扩展之前的答案,在 Diagnostic settings (preview) 窗格下,您现在可以通过 Add diagnostics setting 将多个日志集成到 Azure,这可以存储:

  • AppServiceAntivirusScanAuditLogs
  • AppServiceHTTPLogs
  • AppServiceConsoleLogs
  • AppServiceAppLogs
  • AppServiceFileAuditLogs
  • AppServiceAuditLogs
  • AppServiceIPSecAuditLogs
  • AppServicePlatformLogs
  • 所有指标

您可以将它们发送至:

  • Log Analytics 工作区
  • 存档到存储帐户
  • 流式传输到事件中心
  • 发送给合作伙伴解决方案

此外,Application Insights 正在迁移以由 Log Analytics 提供支持,因此我们正在接近完全集成的指标和日志平台