Приложение Insights Logs Exception в методе trackException повторно - PullRequest
1 голос
/ 02 июля 2019

У меня есть Angular 5 Web App, в котором я настроил Application Insights js версии 1.0.20 (applicationinsights-js).[https://www.npmjs.com/package/applicationinsights-js]

Следующее исключение непрерывно регистрировалось в нашей программе Application Application Insights, из-за которой многие пользователи оказывали влияние.

Application Insights Журналы Exception в методе trackException несколько раз в своей сборке "https://az416426.vo.msecnd.net/scripts/a/ai.0.js"

enter image description here

//This is my ApplicationInsightsService Angular service. 

export class ApplicationInsightsService {
ikey: string;

constructor(private http: HttpClient) {
this.initializeApplicationInsights();
}

public initializeApplicationInsights() {
if (sessionStorage.getItem('ikey')) {
AppInsights.downloadAndSetup({ instrumentationKey: sessionStorage.getItem('ikey') });
}
}

//Track an exception in Appinsights
public logException(e: Error, handledAt?: string, properties?: any, measurements?: any) {
AppInsights.trackException(e, handledAt, properties, measurements);
}

}
`

//And In Angular, I have Global Error Handler,
//where we logged the Exceptions.


const applicationInsightsService = this.injector.get(ApplicationInsightsService);
applicationInsightsService.logException(error);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...