/// <summary> /// Constructor for manual provider initialization /// </summary> /// <param name="logCollector">Logging collector object</param> /// <param name="options">Logger configuration</param> /// <param name="filter">Log sources filter function</param> public DatabaseLoggerProvider(DatabaseLoggerCollector logCollector, DatabaseLoggerOptions options, Func <string, LogLevel, bool>?filter = null) { _filter = filter; _logCollector = logCollector; _options = options; }
/// <summary> /// Constructor for automatic provider initialization /// </summary> /// <param name="logCollector">Log collector object</param> /// <param name="optionsMonitor">Configuration monitor object</param> public DatabaseLoggerProvider(DatabaseLoggerCollector logCollector, IOptionsMonitor <DatabaseLoggerOptions> optionsMonitor) { _filter = (s, l) => true; _logCollector = logCollector; _options = optionsMonitor.CurrentValue; _optionsReloadToken = optionsMonitor.OnChange(ReloadOptions); }
/// <summary> /// Constructor /// </summary> /// <param name="context">Database context</param> /// <param name="logCollector">Log collector object</param> public DatabaseLoggerLogHandler(IDatabaseLoggerDbContext context, DatabaseLoggerCollector logCollector) { _context = context ?? throw new ArgumentNullException(nameof(context)); _logCollector = logCollector ?? throw new ArgumentNullException(nameof(logCollector)); }