AB3594 - Moved the composition root out to UmbracoApplicationBase, and injecting the needed parts from there. Also remove usages of ConfigurationManager from Umbraco.Core

This commit is contained in:
Bjarke Berg
2019-11-15 11:07:37 +01:00
parent 126380dcee
commit 603ec0ccfb
63 changed files with 441 additions and 339 deletions

View File

@@ -0,0 +1,23 @@
using System;
using System.Configuration;
namespace Umbraco.Core.Configuration
{
public class CoreDebug : ICoreDebug
{
public CoreDebug()
{
var appSettings = ConfigurationManager.AppSettings;
LogUncompletedScopes = string.Equals("true", appSettings[Constants.AppSettings.Debug.LogUncompletedScopes], StringComparison.OrdinalIgnoreCase);
DumpOnTimeoutThreadAbort = string.Equals("true", appSettings[Constants.AppSettings.Debug.DumpOnTimeoutThreadAbort], StringComparison.OrdinalIgnoreCase);
}
// when true, Scope logs the stack trace for any scope that gets disposed without being completed.
// this helps troubleshooting rogue scopes that we forget to complete
public bool LogUncompletedScopes { get; }
// when true, the Logger creates a mini dump of w3wp in ~/App_Data/MiniDump whenever it logs
// an error due to a ThreadAbortException that is due to a timeout.
public bool DumpOnTimeoutThreadAbort { get; }
}
}