示例#1
0
 /// <summary>
 /// Creates an instance of <see cref="RavenLoggerProvider"/>
 /// </summary>
 /// <param name="store">The RavenDB document store</param>
 /// <param name="httpContextAccessor">The http context accessor</param>
 /// <param name="optionsMonitor">The options to create <see cref="RavenLogger"/> instances with.</param>
 public RavenLoggerProvider(IDocumentStore store, IHttpContextAccessor httpContextAccessor, IOptionsMonitor <RavenLoggerOptions> optionsMonitor)
 {
     this.httpContextAccessor = httpContextAccessor;
     this.scopeProvider       = NullExternalScopeProvider.Instance;
     this.loggers             = new ConcurrentDictionary <string, RavenLogger>();
     this.store           = store;
     this.loggerProcessor = new RavenLoggerProcessor(store);
     this.optionsMonitor  = optionsMonitor;
     SetOptions(optionsMonitor.CurrentValue);
     optionsReloadToken = optionsMonitor.OnChange(SetOptions);
 }
示例#2
0
 public RavenLogger(string category, RavenLoggerProcessor loggerProcessor, IHttpContextAccessor httpContextAccessor)
 {
     this.loggerProcessor     = loggerProcessor;
     this.Category            = category;
     this.httpContextAccessor = httpContextAccessor;
 }