コード例 #1
0
 /// <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;
 }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
 /// <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));
 }