예제 #1
0
        public ElasticSearchAppender(IElasticClientFactory clientFactory, LogEventSmartFormatter indexName,
                                     LogEventSmartFormatter indexType, IIndexingTimer timer, ITolerateCallsFactory tolerateCallsFactory,
                                     ILogBulkSet bulk, ILogEventConverterFactory logEventConverterFactory, ElasticAppenderFilters elasticFilters,
                                     IFileAccessor fileAccessor, IExternalEventWriter eventWriter)
        {
            _logEventConverterFactory = logEventConverterFactory;
            _elasticClientFactory     = clientFactory;
            IndexName             = indexName;
            IndexType             = indexType;
            _timer                = timer;
            _timer.Elapsed       += (o, e) => DoIndexNow();
            _tolerateCallsFactory = tolerateCallsFactory;
            _bulk         = bulk;
            _fileAccessor = fileAccessor;
            _eventWriter  = eventWriter;

            FixedFields               = FixFlags.Partial;
            SerializeObjects          = true;
            BulkSize                  = 2000;
            BulkIdleTimeout           = 5000;
            DropEventsOverBulkLimit   = false;
            TotalDropEventLimit       = null;
            TimeoutToWaitForTimer     = 5000;
            ElasticSearchTimeout      = 10000;
            IndexAsync                = true;
            Template                  = null;
            AllowSelfSignedServerCert = false;
            Ssl                  = false;
            _tolerateCalls       = _tolerateCallsFactory.Create(0);
            Servers              = new ServerDataCollection();
            ElasticFilters       = elasticFilters;
            AuthenticationMethod = new AuthenticationMethodChooser();
            IndexOperationParams = new IndexOperationParamsDictionary();
        }
예제 #2
0
        public ElasticSearchAppender()
        {
            FixedFields      = FixFlags.Partial;
            SerializeObjects = true;

            BulkSize                = 2000;
            BulkIdleTimeout         = 5000;
            DropEventsOverBulkLimit = false;
            TimeoutToWaitForTimer   = 5000;

            _tolerateCalls = new TolerateCallsBase();

            Servers = new ServerDataCollection();
            ElasticSearchTimeout = 10000;
            IndexName            = "LogEvent-%{+yyyy.MM.dd}";
            IndexType            = "LogEvent";
            IndexAsync           = true;
            Template             = null;
            LogEventFactory      = new BasicLogEventFactory();

            _timer         = new Timer(TimerElapsed, null, Timeout.Infinite, Timeout.Infinite);
            ElasticFilters = new ElasticAppenderFilters();

            AllowSelfSignedServerCert = false;
            Ssl = false;
            AuthenticationMethod = new AuthenticationMethodChooser();
            IndexOperationParams = new IndexOperationParamsDictionary();
        }
예제 #3
0
        public ElasticSearchAppender()
        {
            FixedFields      = FixFlags.Partial;
            SerializeObjects = true;

            BulkSize              = 2000;
            BulkIdleTimeout       = 5000;
            TimeoutToWaitForTimer = 5000;

            Server              = "localhost";
            Port                = 9200;
            IndexName           = "LogEvent-%{+yyyy.MM.dd}";
            IndexType           = "LogEvent";
            IndexAsync          = true;
            MaxAsyncConnections = 10;
            Template            = null;
            LogEventFactory     = new BasicLogEventFactory();

            _timer         = new Timer(TimerElapsed, null, Timeout.Infinite, Timeout.Infinite);
            ElasticFilters = new ElasticAppenderFilters();
        }