/// <summary> /// Constructor. /// <para>The IOptionsMonitor provides the OnChange() method which is called when the user alters the settings of this provider in the appsettings.json file.</para> /// </summary> public WebLoggerProvider(IOptionsMonitor <WebLoggerOptions> settings, IWebLoggerDestination webLoggerDestination) : this(settings.CurrentValue, webLoggerDestination) { // https://docs.microsoft.com/en-us/aspnet/core/fundamentals/change-tokens SettingsChangeToken = settings.OnChange(settings => { _settings = settings; }); }
/// <summary> /// Constructor /// </summary> public WebLoggerProvider(WebLoggerOptions settings, IWebLoggerDestination webLoggerDestination) { _webLoggerDestination = webLoggerDestination; _settings = settings; }