From 738bdfbbdda9fdf4321ee90f927ed1867f409428 Mon Sep 17 00:00:00 2001 From: berg Date: Fri, 18 Sep 2020 07:46:36 +0200 Subject: [PATCH] Moved umbraco file logging into minimal config Signed-off-by: berg --- .../Logging/Serilog/LoggerConfigExtensions.cs | 5 + .../appsettings.Development.json | 10 +- src/Umbraco.Web.UI.NetCore/appsettings.json | 151 ++++++++---------- 3 files changed, 81 insertions(+), 85 deletions(-) diff --git a/src/Umbraco.Infrastructure/Logging/Serilog/LoggerConfigExtensions.cs b/src/Umbraco.Infrastructure/Logging/Serilog/LoggerConfigExtensions.cs index a5e5bdee43..84270b95bf 100644 --- a/src/Umbraco.Infrastructure/Logging/Serilog/LoggerConfigExtensions.cs +++ b/src/Umbraco.Infrastructure/Logging/Serilog/LoggerConfigExtensions.cs @@ -47,6 +47,11 @@ namespace Umbraco.Core.Logging.Serilog .Enrich.With() .Enrich.FromLogContext(); // allows us to dynamically enrich + + logConfig.WriteTo.UmbracoFile( + Path.Combine(loggingConfiguration.LogDirectory, $"UmbracoTraceLog.{Environment.MachineName}..json") + ); + return logConfig; } diff --git a/src/Umbraco.Web.UI.NetCore/appsettings.Development.json b/src/Umbraco.Web.UI.NetCore/appsettings.Development.json index 453f8cca3d..4b1a792942 100644 --- a/src/Umbraco.Web.UI.NetCore/appsettings.Development.json +++ b/src/Umbraco.Web.UI.NetCore/appsettings.Development.json @@ -3,7 +3,7 @@ "MinimumLevel": { "Default": "Information" }, - "WriteTo:1": + "WriteTo":[ { "Name": "Async", "Args": { @@ -14,15 +14,15 @@ ] } } - + ] }, "Umbraco": { "CMS": { "Global":{ "Smtp": { -// "From": "your@email.here", -// "Host": "localhost", -// "Port": "25" + "From": "your@email.here", + "Host": "localhost", + "Port": "25" } }, "Hosting":{ diff --git a/src/Umbraco.Web.UI.NetCore/appsettings.json b/src/Umbraco.Web.UI.NetCore/appsettings.json index 2b4c32b637..99150bce56 100644 --- a/src/Umbraco.Web.UI.NetCore/appsettings.json +++ b/src/Umbraco.Web.UI.NetCore/appsettings.json @@ -1,83 +1,74 @@ { - "ConnectionStrings": { - "umbracoDbDSN": "" - }, - "Serilog": { - "Using": [ - "Umbraco.Infrastructure" - ], - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information", - "System": "Warning" - } - }, - "WriteTo:0": { - "Name": "UmbracoFile", - "Args": { - "path" : "%UMBLOGDIR%/UmbracoTraceLog.%MACHINENAME%..json" - } - } - }, - "Umbraco": { - "CMS": { - "Content": { - "Notifications": { - "Email": "your@email.here" - }, - "MacroErrors": "throw" - }, - "Global": { - "DefaultUILanguage": "en-us", - "HideTopLevelNodeFromPath": true, - "Path": "~/umbraco", - "TimeOutInMinutes": 20, - "UseHttps": false - }, - "Hosting": { - "Debug": false - }, - "KeepAlive": { - "DisableKeepAliveTask": false, - "KeepAlivePingUrl": "{umbracoApplicationUrl}/api/keepalive/ping" - }, - "RequestHandler": { - "ConvertUrlsToAscii": "try" - }, - "RuntimeMinification": { - "dataFolder": "App_Data\\Smidge", - "version": "1" - }, - "Security": { - "KeepUserLoggedIn": false, - "UsernameIsEmail": true, - "HideDisabledUsersInBackoffice": false, - "UserPassword": { - "RequiredLength": 10, - "RequireNonLetterOrDigit": false, - "RequireDigit": false, - "RequireLowercase": false, - "RequireUppercase": false, - "MaxFailedAccessAttemptsBeforeLockout": 5 - }, - "MemberPassword": { - "RequiredLength": 10, - "RequireNonLetterOrDigit": false, - "RequireDigit": false, - "RequireLowercase": false, - "RequireUppercase": false, - "MaxFailedAccessAttemptsBeforeLockout": 5 - } - }, - "Tours": { - "EnableTours": true - }, - "ModelsBuilder": { - "ModelsMode": "PureLive", - "Enable": "true" - } - } + "ConnectionStrings": { + "umbracoDbDSN": "" + }, + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information", + "System": "Warning" + } } + }, + "Umbraco": { + "CMS": { + "Content": { + "Notifications": { + "Email": "your@email.here" + }, + "MacroErrors": "throw" + }, + "Global": { + "DefaultUILanguage": "en-us", + "HideTopLevelNodeFromPath": true, + "Path": "~/umbraco", + "TimeOutInMinutes": 20, + "UseHttps": false + }, + "Hosting": { + "Debug": false + }, + "KeepAlive": { + "DisableKeepAliveTask": false, + "KeepAlivePingUrl": "{umbracoApplicationUrl}/api/keepalive/ping" + }, + "RequestHandler": { + "ConvertUrlsToAscii": "try" + }, + "RuntimeMinification": { + "dataFolder": "App_Data\\Smidge", + "version": "1" + }, + "Security": { + "KeepUserLoggedIn": false, + "UsernameIsEmail": true, + "HideDisabledUsersInBackoffice": false, + "UserPassword": { + "RequiredLength": 10, + "RequireNonLetterOrDigit": false, + "RequireDigit": false, + "RequireLowercase": false, + "RequireUppercase": false, + "MaxFailedAccessAttemptsBeforeLockout": 5 + }, + "MemberPassword": { + "RequiredLength": 10, + "RequireNonLetterOrDigit": false, + "RequireDigit": false, + "RequireLowercase": false, + "RequireUppercase": false, + "MaxFailedAccessAttemptsBeforeLockout": 5 + } + }, + "Tours": { + "EnableTours": true + }, + "ModelsBuilder": { + "ModelsMode": "PureLive", + "Enable": "true" + } + } + } }