问题描述
我想使用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中的跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!