public void Append_WithMockServer_Succeeds()
        {
            var logEventInfo     = new LogEventInfo(LogLevel.Debug, "logger", "message");
            var nLogEventAdapter = new NLogEventAdapter("message", logEventInfo);

            using (var thriftClient = new LegacyThriftClient("localhost", 9090))
            {
                thriftClient.Append(nLogEventAdapter);
            }
        }
Beispiel #2
0
        public static IFlumeClient CreateClient()
        {
            if (_client == null || _client.IsClosed)
            {
                switch (_clientType)
                {
                case ClientType.LegacyThrift:
                    _client = new LegacyThriftClient(_host, _port);
                    break;

                case ClientType.Thrift:
                    _client = new Thrift.ThriftClient(_host, _port);
                    break;

                default:
                    throw new NotSupportedException(
                              string.Format(CultureInfo.InvariantCulture,
                                            "The client type [{0}] is not supported. The only supported type is Thrift.",
                                            _clientType));
                }
            }

            return(_client);
        }