C# 为什么Application Insights TrackException不记录任何内容?
我目前正在尝试将异常记录在Application Insights中,以备日后调查。 但是,我尝试使用TrackException方法记录的任何异常都不会出现在Application Insights中 Application Insights事件筛选的状态如下: 异常-服务器中未捕获的异常,以及使用TrackException()记录的异常 我正在使用以下代码记录我的异常:C# 为什么Application Insights TrackException不记录任何内容?,c#,azure,azure-application-insights,C#,Azure,Azure Application Insights,我目前正在尝试将异常记录在Application Insights中,以备日后调查。 但是,我尝试使用TrackException方法记录的任何异常都不会出现在Application Insights中 Application Insights事件筛选的状态如下: 异常-服务器中未捕获的异常,以及使用TrackException()记录的异常 我正在使用以下代码记录我的异常: private static readonly TelemetryClient Client = new Telemet
private static readonly TelemetryClient Client = new TelemetryClient{InstrumentationKey = ApplicationInsightsSettings.InstrumentationKey};
public static void TrackException(Exception exception, string traceReference)
{
var properties = new Dictionary<string, string> {{"Trace Reference", traceReference}};
Client.TrackException(exception);
Client.TrackException(exception, properties);
Client.TrackEvent(traceReference);
}
private static readonly TelemetryClient=new TelemetryClient{InstrumentationKey=ApplicationInsightsSettings.InstrumentationKey};
公共静态void TrackException(异常异常、字符串跟踪引用)
{
var properties=newdictionary{{“跟踪引用”,traceReference};
Client.TrackException(异常);
Client.TrackException(异常、属性);
Client.TrackEvent(traceReference);
}
试试这个,您在哪里/如何搜索异常?在azure门户或azure门户中的本地env?@Leonardo上。底部链接中的图像显示了我的搜索条件。(我无法嵌入它,因为我没有足够的声誉)@abhinavpratap Flush似乎无法解决这个问题。但是,我确实注意到运行时输出中有以下行:“由SamplingTelemetryProcessor过滤”。