public SMSArbiter(IOptionsMonitor <UTAPConfiguration> options, IHubContext <ChatHub> chatHub) { _hubContext = chatHub; this._settings = options.CurrentValue; if (!String.IsNullOrEmpty(_settings.ATSquirterIP)) { Log.Logger = new LoggerConfiguration() .WriteTo.File(_settings.LogFilePath, rollingInterval: RollingInterval.Hour) .WriteTo.Console() .MinimumLevel.Is((Serilog.Events.LogEventLevel)Enum.Parse(typeof(Serilog.Events.LogEventLevel), _settings.MinimumLogLevel)) .CreateLogger(); Log.Information("Starting UTAP..."); options.OnChange(Listener); Log.Information("Starting DBManager with connection string: {conString}", _settings.UCCSConString); _DBManager = new DBManager(_settings.UCCSConString, _settings.UCCSReadInterval); EnqueuePendingMessages(); } }
private void Listener(UTAPConfiguration options) { _settings = options; }