NLog异常作为Application Insights中的跟踪 [英] NLog exceptions as Trace in Application Insights

查看:74
本文介绍了NLog异常作为Application Insights中的跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用NLog将异常记录到Application Insights.我整合了我的项目和应用程序见解.真正的问题是NLog具有不同的记录器类型,例如警告,信息,错误,调试,致命.当我尝试使用这些在应用程序见解中进行记录时,我将所有这些异常作为跟踪错误得到.请在下面的屏幕截图中找到.我希望他们按照严重程度在那儿命名.

Hi I want to log exceptions to Application Insights using NLog. I integrated both my project and application insights. The real problem here is NLog has different logger types such as warn, info, error, debug, fatal. When I am trying to log using these in app insights I get all these exceptions as Trace errors. Please find in the below screen shot. I want them to be there name as per the severity.

推荐答案

跟踪遥测具有一个名为严重性"的属性,另请参见

The Trace Telemetry has a property called 'Severity', see also the docs so the severity is logged correctly.

根据您的屏幕截图,一切都正确,我看到了错误信息,信息和调试,那么怎么了?

According to your screenshot everything is right, i see Error Info, Info and Debug so what is wrong?

黄色部分只是遥测(跟踪)的类型,与严重程度无关.

The yellow part is just the type of telemetry (Trace) and has nothing to do with the severity.

这篇关于NLog异常作为Application Insights中的跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆