コード例 #1
0
        public static HttpLogstashEcsSinkState Create(HttpLogstashEcsSinkOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            return(new HttpLogstashEcsSinkState(options));
        }
コード例 #2
0
        private HttpLogstashEcsSinkState(HttpLogstashEcsSinkOptions options)
        {
            Options = options;

            Formatter = options.CustomFormatter ?? new HttpLogstashEcsJsonFormatter(
                formatProvider: options.FormatProvider,
                renderMessage: true,
                closingDelimiter: string.Empty,
                inlineFields: options.InlineFields
                );
            DurableFormatter = options.CustomDurableFormatter ?? new HttpLogstashEcsJsonFormatter(
                formatProvider: options.FormatProvider,
                renderMessage: true,
                closingDelimiter: Environment.NewLine,
                inlineFields: options.InlineFields
                );
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpLogstashEcsSink"/> class with the provided options
 /// </summary>
 /// <param name="options">
 /// Options configuring how the sink behaves, may NOT be null
 /// </param>
 public HttpLogstashEcsSink(HttpLogstashEcsSinkOptions options)
     : base(options.BatchPostingLimit, options.Period)
 {
     _state = HttpLogstashEcsSinkState.Create(options);
 }