Esempio n. 1
0
 public TcpTransport(TcpTransportConfiguration configuration,
                     IGelfMessageSerializer messageSerializer,
                     Func <ITcpConnection> createConnection)
 {
     this.configuration     = configuration;
     this.messageSerializer = messageSerializer;
     this.createConnection  = createConnection;
 }
Esempio n. 2
0
 internal TcpTransport(string hostName, int port, bool useSecureConnection, bool useNullByteDelimiter, IGelfMessageSerializer messageSerializer)
 {
     _hostName             = hostName;
     _port                 = port;
     _useSecureConnection  = useSecureConnection;
     _useNullByteDelimiter = useNullByteDelimiter;
     _messageSerializer    = messageSerializer;
 }
Esempio n. 3
0
 public UdpTransport(
     UdpTransportConfiguration configuration,
     ITransportEncoder encoder,
     IGelfMessageSerializer messageSerializer)
 {
     this.configuration     = configuration;
     this.encoder           = encoder;
     this.messageSerializer = messageSerializer;
 }
Esempio n. 4
0
        public HttpTransport(Uri uri, IGelfMessageSerializer messageSerializer)
        {
            _uri = uri ?? throw new ArgumentNullException(nameof(uri));
            _messageSerializer = messageSerializer ?? throw new ArgumentNullException(nameof(messageSerializer));
            _client            = new HttpClient();
            _client.DefaultRequestHeaders.ExpectContinue = false; // important, cannot be handled by GRAYLOG
            var sp = ServicePointManager.FindServicePoint(_uri);

            sp.ConnectionLeaseTimeout = 60 * 1000; // 1 minute
        }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UdpTransport"/> class.
 /// </summary>
 /// <param name="configuration">The <see cref="UdpTransportConfiguration"/> containing all settings used to establish a connection to a GrayLog UDP input.</param>
 /// <param name="encoder">The <see cref="ITransportEncoder"/> used to chunk messages, exceeding the configured maximum message size.</param>
 /// <param name="messageSerializer">The <see cref="IGelfMessageSerializer"/> used to generate a byte sequence from a <see cref="GelfMessage"/> instance.</param>
 /// <exception cref="ArgumentNullException">Thrown if either of <paramref name="configuration"/>, <paramref name="encoder"/> or <paramref name="messageSerializer"/> is <c>NULL</c>.</exception>
 public UdpTransport(string host, int port, IGelfMessageSerializer messageSerializer, GelfChunkEncoder chunkEncoder, int minMessageSizeBeforeCompressing)
 {
     _host = host;
     _port = port;
     _messageSerializer = messageSerializer ?? throw new ArgumentNullException(nameof(messageSerializer));
     _chunkEncoder      = chunkEncoder ?? throw new ArgumentNullException(nameof(chunkEncoder));
     MinMessageSizeBeforeCompressing = minMessageSizeBeforeCompressing < 0
                                       ? 0 // always compress
                                       : minMessageSizeBeforeCompressing;
 }
Esempio n. 6
0
 public TcpTransport(TcpTransportConfiguration configuration, IGelfMessageSerializer messageSerializer)
 {
     this.configuration = configuration;
     this.messageSerializer = messageSerializer;
 }
Esempio n. 7
0
 public UdpTransport(UdpTransportConfiguration configuration, ITransportEncoder encoder, IGelfMessageSerializer messageSerializer)
 {
     this.configuration = configuration;
     this.encoder = encoder;
     this.messageSerializer = messageSerializer;
 }
Esempio n. 8
0
 public HttpTransport(HttpTransportConfiguration configuration, IGelfMessageSerializer messageSerializer)
 {
     this.configuration     = configuration;
     this.messageSerializer = messageSerializer;
 }