![](/img/trans.png)
[英]How to default overview dashboard as group by type in portal.azure.com
[英]How to use BeginScope in Azure Application Insights (in https://portal.azure.com)?
我的 C# 代碼是log.BeginScope("Testing Scope1");
和log.BeginScope("Testing Scope2");
. 我如何在 Azure Application Insights 中使用(在https://portal.azure.Z4D5Z56D9A2DDABEC )中
如果您的代碼如下所示:
using (_logger.BeginScope("Testing Scope1"))
{
_logger.LogInformation("this is an info from index page 111111");
}
然后,在執行代碼后,導航到 azure 門戶 -> 您的應用程序洞察 -> 日志 -> 在traces
表中,編寫以下查詢(還要注意 select 是一個適當的“時間范圍”):
traces
| where customDimensions.Scope contains "Testing Scope1"
| project message, customDimensions
截圖如下:
順便說一句,生成日志可能需要幾分鍾。 並且請在您的應用程序中設置正確的日志級別(例如在 azure function 中設置正確的日志級別)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.