Skip to content

Commit

Permalink
Adjusting logging hosting defaults to what the codegen templates gene…
Browse files Browse the repository at this point in the history
…rate
  • Loading branch information
Piedone committed Nov 10, 2024
1 parent aa8f57c commit 9ed57dd
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ public static OrchardCoreBuilder ConfigureHostingDefaults(
var logLevelSection = webApplicationBuilder.Configuration.GetSection("Logging:LogLevel");
var elasticSearchSection = ocSection.GetSection("OrchardCore_Elasticsearch");

logLevelSection.AddValueIfKeyNotExists("Default", "Warning");

if (webApplicationBuilder.Environment.IsDevelopment())
{
logLevelSection
.AddValueIfKeyNotExists("Default", "Debug")
.AddValueIfKeyNotExists("System", "Information")
.AddValueIfKeyNotExists("Microsoft", "Information");
logLevelSection.AddValueIfKeyNotExists("Microsoft.Hosting.Lifetime", "Information");

// Orchard Core 1.8 and prior section. Keeping it here for leftover configs, because it keeps working under
// 2.0 too
Expand Down Expand Up @@ -70,9 +69,7 @@ public static OrchardCoreBuilder ConfigureHostingDefaults(
}
else
{
logLevelSection
.AddValueIfKeyNotExists("Default", "Warning")
.AddValueIfKeyNotExists("Microsoft.AspNetCore", "Warning");
logLevelSection.AddValueIfKeyNotExists("Microsoft.AspNetCore", "Warning");

ocSection.AddValueIfKeyNotExists("DatabaseProvider", "SqlConnection");

Expand Down

0 comments on commit 9ed57dd

Please sign in to comment.