Exemplo n.º 1
0
 /// <summary>
 /// Creates an instance of the Splunk TCP Sink.
 /// </summary>
 /// <param name="connectionInfo">Connection info used for connecting against Splunk.</param>
 /// <param name="formatter">Custom formatter to use if you e.g. do not want to use the JsonFormatter.</param>
 public TcpSink(
     SplunkTcpSinkConnectionInfo connectionInfo,
     ITextFormatter formatter)
 {
     _writer    = CreateSocketWriter(connectionInfo);
     _formatter = formatter;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an instance of the Splunk TCP Sink.
 /// </summary>
 /// <param name="connectionInfo">Connection info used for connecting against Splunk.</param>
 /// <param name="formatProvider">Optional format provider</param>
 /// <param name="renderTemplate">If true, the message template will be rendered</param>
 public TcpSink(
     SplunkTcpSinkConnectionInfo connectionInfo,
     IFormatProvider formatProvider = null,
     bool renderTemplate            = true)
 {
     _writer    = CreateSocketWriter(connectionInfo);
     _formatter = CreateDefaultFormatter(formatProvider, renderTemplate);
 }
Exemplo n.º 3
0
        private static TcpSocketWriter CreateSocketWriter(SplunkTcpSinkConnectionInfo connectionInfo)
        {
            var reconnectionPolicy = new ExponentialBackoffTcpReconnectionPolicy();

            return(new TcpSocketWriter(connectionInfo.Host, connectionInfo.Port, reconnectionPolicy, connectionInfo.MaxQueueSize));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Creates an instance of the Splunk TCP Sink.
 /// </summary>
 /// <param name="connectionInfo">Connection info used for connecting against Splunk.</param>
 /// <param name="formatProvider">Optional format provider</param>
 /// <param name="renderTemplate">If true, the message template will be rendered</param>
 public TcpSink(SplunkTcpSinkConnectionInfo connectionInfo, IFormatProvider formatProvider = null, bool renderTemplate = true)
     : this(connectionInfo, CreateDefaultFormatter(formatProvider, renderTemplate))
 {
 }