Application Insights TraceListener:设置严重级别

Application Insights TraceListener: Setting Severity level

这个问题的答案可能很简单,但我想设置所报告的跟踪事件的严重性级别。

我正在使用 Application Insights API 和 Application Insights TraceListener 的预发布版本。

基本上我只是想过滤掉具有详细严重性的 Trace 事件。我知道我可以在 Azure 门户中查看应用程序见解时将它们过滤掉,但我宁愿根本不报告它们。有没有办法为 Application Insights 设置跟踪事件的严重级别?

这是一个已知的限制,如果您在配置过滤器中的 "listeners" 标记下添加应用程序洞察侦听器将不起作用。 但是,如果您将它添加到 shared listeners 下并使用过滤器,它应该可以工作。