public void Post(List <Uri> uris, string indexName, logEvent item) { if (_elasticClient == null) { CreateElasticClient(uris); } var elasticResponse = _elasticClient.Index(item, i => i.Index(indexName)); if (!elasticResponse.IsValid) { throw new Exception($"Logging to ElasticSearch failed. Response: {elasticResponse}"); } }