簡體   English   中英

Azure Application Insights 跟蹤未顯示

[英]Azure Application Insights traces not showing

我正在嘗試為我的 .NET 6 Blazor 服務器應用程序配置日志記錄。 過去這對我來說不是問題,但現在我在 Azure 上看不到任何 Traces 日志。 我一直在關注這些問題:

Application Insights 的日志未寫入跟蹤日志

ILogger 日志記錄未顯示在 Azure Application Insights 中

此外,我在這里遵循了文檔:

使用 .NET 進行 Application Insights 日志記錄

ASP.NET 核心應用的應用洞察

從 Application Insights 檢測密鑰遷移到連接字符串

Application Insights 中的采樣

編碼

應用設置

"Logging": {
    "LogLevel": {
      "Default": "Warning"
    },
    "ApplicationInsights": {
      "LogLevel": {
        "Default": "Warning"
      }
    }
  },

"ApplicationInsights": {
    "ConnectionString": "
InstrumentationKey=Here i put the InstrumentationKey ofc. ;IngestionEndpoint=https://northeurope2.in.applicationinsights.azure.com/
;LiveEndpoint=https://northeurope.livediagnostics.monitor.azure.com/"
  },

程序.cs

var options = new ApplicationInsightsServiceOptions { ConnectionString = configuration["ApplicationInsights:ConnectionString"] };
builder.Services.AddApplicationInsightsTelemetry(options);

razor.cs 頁面

    [Inject]
    public ILogger<NailOtherSingelShearTimberTimber> Logger { get; set; }

    public async Task SaveFile()
    {
        Logger.LogWarning("File saved");       
    }

如果我在本地運行它,我可以看到它正在發送......

在此處輸入圖像描述

但無論我等多久,我在 Azure 上一無所獲。

在此處輸入圖像描述

並且數據采樣設置為100%

在此處輸入圖像描述

有誰知道我做錯了什么?

兩天沒有成功后,我決定刪除 web 應用程序 + 資源組並創建一個新的 web 應用程序。 然后我更新了 AppSettings 中的連接字符串,發布了應用程序,現在日志記錄就像一個魅力。

暫無
暫無

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

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