Azure Service Fabric 日志记录到 Azure 诊断不起作用

Azure Service Fabric logging to Azure Diagnostics is not working

我尝试设置将 Service Fabric 日志传输到 Azure Diagnostic 并且我使用了这篇文章

https://azure.microsoft.com/en-us/documentation/articles/service-fabric-diagnostics-how-to-setup-wad/

[EventSource(Name = "MyCompany-MyApp-WebApi")]
internal sealed class ServiceEventSource : EventSource {}

并且我向 Clustermanifest 添加了一个新的提供程序

{
  "provider": "MyCompany-MyApp-WebApi",
  "scheduledTransferPeriod": "PT5M",
  "DefaultEvents": {
    "eventDestination": "ServiceFabricReliableServiceEventTable"
  }
},

它实际上将所有日志发送到 Azure 诊断,但所有日志条目都是空的(见图)

azure table pic

尝试将 eventDestination 值修改为仅 EventTable。集群清单应如下所示:

{ "provider": "MyCompany-MyApp-WebApi", "scheduledTransferPeriod": "PT5M", "DefaultEvents":{ "eventDestination": "EventTable " } },

看看这个 sample。示例具有 ARM 模板来创建带有诊断的集群,还可以帮助您为多个集群提供相同的诊断存储 table。它还可以用于 Azure 服务,如 web api。如果对您有帮助,将不胜感激