即使集成已完成,也无法在Azure门户中查看相应的日志。
已遵循https://louiseclark.tech/azure-application-insights/adding-application-insights-angular中提供的说明
需要在Azure门户中查看所有详细信息,如用户名、当前url、名称。我是需要自己传递所有的参数,还是应用程序的洞察力会自动捕获这些参数。请帮帮忙。
in app-insights-service
constructor(private router: Router) {
if (!AppInsights.config) {
AppInsights.downloadAndSetup(this.config);
}
}
logPageView(name: string, url?: string, properties?: any, measurements?: any, duration?: number) {
AppInsights.trackPageView(name, url, properties, measurements, duration);
}
in app.component.ts, in constructor, I invoked these by
this.appInsightsService.logPageView('Sequation-UI-PageView');我是否需要像这样传递参数,或者Application Insight将自己捕获详细信息。
发布于 2019-06-25 16:14:41
发布于 2019-06-27 18:31:15
Azure Application Insights的所有自定义方法都有效,但取决于您调用这些方法的方式和位置。对于页面名称,我从URL中获取它,并在app.component.ts中调用trackPageView(),然后从URL中传递第一个参数。
对于用户名,我在用户登录后获取登录名,并调用登录服务中的appInsight方法setAuthenticatedUserContext,并将用户名作为参数暂停。
对于事件,我使用angular hostListener获取事件并调用appInsight方法trackEvent(),并将获取的事件作为参数传递。
这对我很有效。
https://stackoverflow.com/questions/56747794
复制相似问题