使用 Serilog 在 ApplicationInsights 中記錄資訊后,以下屬性 MS_ 將出現在屬性名稱中。這是什么意思,可以洗掉嗎?
MS_OperationContext MS_HostInstanceId MS_FunctionName
uj5u.com熱心網友回復:
使用 Serilog 在 ApplicationInsights 中記錄資訊后,以下屬性 MS_ 將出現在屬性名稱中。這是什么意思,可以洗掉嗎?
似乎它的屬性命名或自定義維度命名約定是這樣設計的,即MS_PropertyName
namespace Microsoft.Azure.WebJobs.Logging
{
/// <summary>
/// A collection of constants used for logging scope keys.
/// </summary>
public static class ScopeKeys
{
/// <summary>
/// A key identifying the function invocation id.
/// </summary>
public const string FunctionInvocationId = "MS_FunctionInvocationId";
/// <summary>
/// A key identifying the function name.
/// </summary>
public const string FunctionName = "MS_FunctionName";
/// <summary>
/// A key identifying the event starting with the current scope
/// </summary>
public const string Event = "MS_Event";
/// <summary>
/// A key identifying the current host instance.
/// </summary>
public const string HostInstanceId = "MS_HostInstanceId";
/// <summary>
/// A key identifying the current invocation trigger details.
/// </summary>
public const string TriggerDetails = "MS_TriggerDetails";
}
}
您可以參考應用洞察力中的自定義維度更改名稱為 FunctionName,ScopeKeys.cs和 LogWarning 將 LogLevel 顯示為資訊
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/420912.html
標籤:
