【问题标题】:Service Fabric Sample Application missing log messages when deployed to Azure部署到 Azure 时,Service Fabric 示例应用程序缺少日志消息
【发布时间】:2020-02-26 20:55:31
【问题描述】:

我正在尝试让默认 Service Fabric 应用日志记录在 Azure 中以与本地相同的方式工作。

在 Visual Studio 2019 v16.4.5 中,我创建了示例 Service Fabric 无状态应用程序 .Net Core 3.1。 一切在本地构建和运行都可以。 在诊断事件窗口中,如果来自示例源代码,我可以看到应用程序日志消息“Working-1522”:

ServiceEventSource.Current.ServiceMessage(this.Context, "Working-{0}", ++iterations);

但是.. 当我部署到 Azure 时,它​​部署正常并且运行正常,但我不再在任何存储 WADServiceFabricSystemEventTable 或 WADServiceFabricReliableServiceEventTable 表中看到“Working-1522”消息。 我在任何地方都看不到这些消息。

我没有使用 Application Insights。节点具有 IaaSDiagnostics Microsoft.Azure.Diagnostics 扩展,具有以下设置:

{
  "WadCfg": {
    "DiagnosticMonitorConfiguration": {
      "overallQuotaInMB": "50000",
      "sinks": "applicationInsights",
      "EtwProviders": {
        "EtwEventSourceProviderConfiguration": [
          {
            "provider": "Microsoft-ServiceFabric-Actors",
            "scheduledTransferKeywordFilter": "1",
            "scheduledTransferPeriod": "PT5M",
            "DefaultEvents": {
              "eventDestination": "ServiceFabricReliableActorEventTable"
            }
          },
          {
            "provider": "Microsoft-ServiceFabric-Services",
            "scheduledTransferPeriod": "PT5M",
            "DefaultEvents": {
              "eventDestination": "ServiceFabricReliableServiceEventTable"
            }
          }
        ],
        "EtwManifestProviderConfiguration": [
          {
            "provider": "cbd93bc2-71e5-4566-b3a7-595d8eeca6e8",
            "scheduledTransferLogLevelFilter": "Information",
            "scheduledTransferKeywordFilter": "4611686018427387904",
            "scheduledTransferPeriod": "PT5M",
            "DefaultEvents": {
              "eventDestination": "ServiceFabricSystemEventTable"
            }
          }
        ]
      }
    },
    "SinksConfig": {
      "Sink": [
        {
          "name": "applicationInsights",
          "ApplicationInsights": ""
        }
      ]
    }
  },
  "StorageAccount": "wad34xxxxxxxxxxx"
}

有什么建议吗?

【问题讨论】:

    标签: azure logging azure-service-fabric


    【解决方案1】:

    你关注this walkthrough了吗? 您似乎缺少存储帐户详细信息:

    "type": "IaaSDiagnostics",
            "autoUpgradeMinorVersion": true,
            "protectedSettings": {
            "storageAccountName": "[parameters('applicationDiagnosticsStorageAccountName')]",
            "storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('applicationDiagnosticsStorageAccountName')),'2015-05-01-preview').key1]",
            "storageAccountEndPoint": "https://core.windows.net/"
            },
    

    【讨论】:

      猜你喜欢
      • 2016-12-09
      • 2017-04-16
      • 1970-01-01
      • 2017-02-10
      • 2019-12-04
      • 2019-03-28
      • 1970-01-01
      • 2019-03-15
      • 2019-02-14
      相关资源
      最近更新 更多