diff --git a/src/BestClipOfTheWeek/Extensions/IWebHostBuilderExtensions.cs b/src/BestClipOfTheWeek/Extensions/IWebHostBuilderExtensions.cs index 9678700a..6b8dae9f 100644 --- a/src/BestClipOfTheWeek/Extensions/IWebHostBuilderExtensions.cs +++ b/src/BestClipOfTheWeek/Extensions/IWebHostBuilderExtensions.cs @@ -15,13 +15,14 @@ public static IWebHostBuilder AddLogging(this IWebHostBuilder webHostBuilder) return webHostBuilder.UseSerilog((hostingContext, loggingConfiguration) => { var logDirectory = hostingContext.Configuration["LogDirectory"]; - if (!string.IsNullOrEmpty(logDirectory)) { + if (!string.IsNullOrEmpty(logDirectory)) + { var logPath = Path.Combine(logDirectory, "log.txt"); loggingConfiguration.WriteTo.File(logPath, rollingInterval: RollingInterval.Day); } loggingConfiguration - .MinimumLevel.Debug() + .ReadFrom.Configuration(hostingContext.Configuration) .Enrich.FromLogContext() .Enrich.WithExceptionDetails() .WriteTo.Console(); diff --git a/src/BestClipOfTheWeek/appsettings.Development.json b/src/BestClipOfTheWeek/appsettings.Development.json index 0c7c6904..683b4f58 100644 --- a/src/BestClipOfTheWeek/appsettings.Development.json +++ b/src/BestClipOfTheWeek/appsettings.Development.json @@ -2,12 +2,13 @@ "ConnectionStrings": { "DefaultConnection": "Data Source=bcotw.sqlite" }, - "Logging": { - "LogLevel": { + "Serilog": { + "MinimumLevel": { "Default": "Information", - "Microsoft": "Warning", - "Microsoft.AspNetCore.SpaProxy": "Information", - "Microsoft.Hosting.Lifetime": "Information" + "Override": { + "Microsoft": "Information", + "System": "Information" + } } }, "Email": { diff --git a/src/BestClipOfTheWeek/appsettings.json b/src/BestClipOfTheWeek/appsettings.json index 54949058..14d04e03 100644 --- a/src/BestClipOfTheWeek/appsettings.json +++ b/src/BestClipOfTheWeek/appsettings.json @@ -2,11 +2,13 @@ "ConnectionStrings": { "DefaultConnection": "Data Source=/var/www/bcotw/Database.sqlite" }, - "Logging": { - "LogLevel": { + "Serilog": { + "MinimumLevel": { "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" + "Override": { + "Microsoft": "Warning", + "System": "Warning" + } } }, "Email": {