public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddAppInsights(app.ApplicationServices); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddAppInsights(app.ApplicationServices); app.UseMvc(); app.UseSwagger(apiTitle, apiVersion); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddAppInsights(app.ApplicationServices); app.UseAuthentication(); app.UseSecurityContext(); app.UseMvc(); app.UseSwagger(); }
public static ILoggerFactory AddAppInsights(this ILoggerFactory loggerFactory, string instrumentationKey, bool developerMode = false) { return(loggerFactory.AddAppInsights((category, logLevel) => logLevel >= LogLevel.Information, instrumentationKey, developerMode)); }