/// <summary> /// Construct a sink posting to the specified database. /// </summary> /// <param name="kinesisFirehoseClient">The Amazon Kinesis Firehose client.</param> /// <param name="options">Options for configuring how the sink behaves, may NOT be null.</param> public KinesisFirehoseSink(KinesisFirehoseSinkOptions options, IAmazonKinesisFirehose kinesisFirehoseClient) : base(options.BatchPostingLimit, options.Period) { _state = new KinesisSinkState(options, kinesisFirehoseClient); _minimumAcceptedLevel = _state.Options.MinimumLogEventLevel; }
public DurableKinesisFirehoseSink(KinesisFirehoseSinkOptions options, IAmazonKinesisFirehose kinesisFirehoseClient) { var state = new KinesisSinkState(options, kinesisFirehoseClient); if (string.IsNullOrWhiteSpace(options.BufferBaseFilename)) { throw new ArgumentException("Cannot create the durable Amazon Kinesis Firehose sink without a buffer base file name."); } _sink = new RollingFileSink( options.BufferBaseFilename + "-{Date}.json", state.DurableFormatter, options.BufferFileSizeLimitBytes, null); _shipper = new HttpLogShipper(state); if (options.OnLogSendError != null) { _shipper.LogSendError += options.OnLogSendError; } }
public DurableKinesisFirehoseSink(KinesisFirehoseSinkOptions options, IAmazonKinesisFirehose kinesisFirehoseClient) { var state = new KinesisSinkState(options, kinesisFirehoseClient); if (string.IsNullOrWhiteSpace(options.BufferBaseFilename)) { throw new ArgumentException("Cannot create the durable Amazon Kinesis Firehose sink without a buffer base file name."); } _sink = new RollingFileSink( options.BufferBaseFilename + "-{Date}.json", state.DurableFormatter, options.BufferFileSizeLimitBytes, null, shared: options.Shared); _shipper = new HttpLogShipper(state); _logSendErrorHandler = options.OnLogSendError; if (_logSendErrorHandler != null) { _shipper.LogSendError += _logSendErrorHandler; } }