public ElasticsearchLoggerProvider(IOptionsMonitor <ElasticsearchLoggerOptions> options) { _options = options; _shipper = new ElasticsearchChannel <LogEvent>(options.CurrentValue); _loggers = new ConcurrentDictionary <string, ElasticsearchLogger>(); ReloadLoggerOptions(options.CurrentValue); _optionsReloadToken = _options.OnChange(ReloadLoggerOptions); }
internal ElasticsearchLogger( string categoryName, ElasticsearchChannel <LogEvent> channel, ElasticsearchLoggerOptions options, IExternalScopeProvider?scopeProvider ) { _categoryName = categoryName; _channel = channel; _options = options; _scopeProvider = scopeProvider; }
public ElasticsearchLoggerProvider(IOptionsMonitor <ElasticsearchLoggerOptions> options, IEnumerable <IChannelSetup> channelConfigurations ) { _options = options; _channelConfigurations = channelConfigurations.ToArray(); var channelOptions = CreateChannelOptions(options.CurrentValue, _channelConfigurations); _shipper = new ElasticsearchChannel <LogEvent>(channelOptions); _loggers = new ConcurrentDictionary <string, ElasticsearchLogger>(); ReloadLoggerOptions(options.CurrentValue); _optionsReloadToken = _options.OnChange(ReloadLoggerOptions); }
public ElasticsearchLoggerProvider(IOptionsMonitor <ElasticsearchLoggerOptions> options, IEnumerable <IChannelSetup> channelConfigurations ) { _options = options ?? throw new ArgumentNullException(nameof(options)); if (channelConfigurations is null) { throw new ArgumentNullException(nameof(channelConfigurations)); } _channelConfigurations = channelConfigurations.ToArray(); var channelOptions = CreateChannelOptions(options.CurrentValue, _channelConfigurations); _shipper = new ElasticsearchChannel <LogEvent>(channelOptions); ReloadLoggerOptions(options.CurrentValue); _optionsReloadToken = _options.OnChange(o => ReloadLoggerOptions(o)); }
public TestSession(ITransport <ITransportConfiguration> transport) { Transport = transport; BufferOptions = new BufferOptions <Base>() { ConcurrentConsumers = 1, MaxConsumerBufferSize = 2, MaxConsumerBufferLifetime = TimeSpan.FromSeconds(10), WaitHandle = WaitHandle, MaxRetries = 3, BackoffPeriod = times => TimeSpan.FromMilliseconds(1), ServerRejectionCallback = (list) => Interlocked.Increment(ref _rejections), BulkAttemptCallback = (c, a) => Interlocked.Increment(ref _requests), ElasticsearchResponseCallback = (r, b) => Interlocked.Increment(ref _responses), MaxRetriesExceededCallback = (list) => Interlocked.Increment(ref _maxRetriesExceeded), RetryCallBack = (list) => Interlocked.Increment(ref _retries), ExceptionCallback = (e) => LastException = e }; ChannelOptions = new ElasticsearchChannelOptions <Base>(transport) { BufferOptions = BufferOptions }; Channel = new ElasticsearchChannel <Base>(ChannelOptions); }
internal ElasticsearchLogger(string categoryName, ElasticsearchChannel <LogEvent> channel) { _categoryName = categoryName; _channel = channel; }