Skip to content

Commit

Permalink
Configure Application Insights more correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanSaeed committed Apr 3, 2020
1 parent 53c6fc9 commit c1118ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions Source/ApiTemplate/Source/ApiTemplate/Program.cs
Expand Up @@ -6,9 +6,6 @@ namespace ApiTemplate
using System.Reflection;
using System.Threading.Tasks;
using Boxed.AspNetCore;
#if ApplicationInsights
using Microsoft.ApplicationInsights.Extensibility;
#endif
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -138,7 +135,7 @@ private static Logger CreateLogger(IHost host)
#if ApplicationInsights
.WriteTo.Conditional(
x => hostEnvironment.IsProduction(),
x => x.ApplicationInsights(TelemetryConfiguration.CreateDefault(), TelemetryConverter.Traces))
x => x.ApplicationInsights(TelemetryConverter.Traces))
#endif
.CreateLogger();
}
Expand Down
5 changes: 1 addition & 4 deletions Source/GraphQLTemplate/Source/GraphQLTemplate/Program.cs
Expand Up @@ -6,9 +6,6 @@ namespace GraphQLTemplate
using System.Reflection;
using System.Threading.Tasks;
using Boxed.AspNetCore;
#if ApplicationInsights
using Microsoft.ApplicationInsights.Extensibility;
#endif
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -146,7 +143,7 @@ private static Logger CreateLogger(IHost host)
#if ApplicationInsights
.WriteTo.Conditional(
x => hostEnvironment.IsProduction(),
x => x.ApplicationInsights(TelemetryConfiguration.CreateDefault(), TelemetryConverter.Traces))
x => x.ApplicationInsights(TelemetryConverter.Traces))
#endif
.CreateLogger();
}
Expand Down
Expand Up @@ -5,9 +5,6 @@ namespace OrleansTemplate.Server
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
#if ApplicationInsights
using Microsoft.ApplicationInsights.Extensibility;
#endif
#if HealthCheck
using Microsoft.AspNetCore.Hosting;
#endif
Expand Down Expand Up @@ -195,7 +192,7 @@ private static Logger CreateLogger(IHost host)
#if ApplicationInsights
.WriteTo.Conditional(
x => hostEnvironment.IsProduction(),
x => x.ApplicationInsights(TelemetryConfiguration.CreateDefault(), TelemetryConverter.Traces))
x => x.ApplicationInsights(TelemetryConverter.Traces))
#endif
.CreateLogger();
}
Expand Down

0 comments on commit c1118ab

Please sign in to comment.