簡體   English   中英

部署到 Azure 時 Service Fabric 示例應用程序丟失日志消息

[英]Service Fabric Sample Application missing log messages when deployed to Azure

我試圖讓默認的 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"
}

有什么建議?

您是否遵循此演練 您似乎缺少存儲帳戶詳細信息:

"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/"
        },

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM