Skip to content

Commit

Permalink
Fix boilerplate's app insight issue for server
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Apr 7, 2024
1 parent af668ce commit 80ba723
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ private static void ConfigureServices(this WebApplicationBuilder builder)
.Configure<BrotliCompressionProviderOptions>(opt => opt.Level = CompressionLevel.Fastest)
.Configure<GzipCompressionProviderOptions>(opt => opt.Level = CompressionLevel.Fastest);

//#if (appInsights == true)
builder.Logging.AddApplicationInsights();
services.AddApplicationInsightsTelemetry(configuration);
//#endif

//#if (api == true)

var appSettings = configuration.GetSection(nameof(AppSettings)).Get<AppSettings>()!;
Expand Down Expand Up @@ -139,11 +144,6 @@ private static void ConfigureServices(this WebApplicationBuilder builder)
//#endif

AddBlazor(builder);

//#if (appInsights == true)
builder.Logging.AddApplicationInsights();
services.AddApplicationInsightsTelemetry(configuration);
//#endif
}

private static void AddBlazor(WebApplicationBuilder builder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"Logging": {
"LogLevel": {
"Default": "Information"
},
//#if (appInsights == true)
"ApplicationInsights": {
"LogLevel": {
"Default": "Information"
}
}
//#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
"Default": "Warning",
"Boilerplate.Client.Core.Components.AuthenticationStateLogger": "Information",
"Microsoft.EntityFrameworkCore.Database.Command": "Information"
},
//#if (appInsights == true)
"ApplicationInsights": {
"LogLevel": {
"Default": "Warning",
"Boilerplate.Client.Core.Components.AuthenticationStateLogger": "Information",
"Microsoft.EntityFrameworkCore.Database.Command": "Information"
}
}
//#endif
},
"ApiServerAddress": "http://localhost:5030/", // You can also use relative urls such as / for Blazor Server and WebAssembly
"WindowsUpdateSettings": {
Expand Down

0 comments on commit 80ba723

Please sign in to comment.