diff --git a/exporters/elasticsearch/src/es_log_record_exporter.cc b/exporters/elasticsearch/src/es_log_record_exporter.cc index bfc1ad3d64..1cf7fb7d97 100644 --- a/exporters/elasticsearch/src/es_log_record_exporter.cc +++ b/exporters/elasticsearch/src/es_log_record_exporter.cc @@ -288,7 +288,12 @@ class AsyncResponseHandler : public http_client::EventHandler #endif ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter() - : options_{ElasticsearchExporterOptions()}, + : ElasticsearchLogRecordExporter(ElasticsearchExporterOptions()) +{} + +ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter( + const ElasticsearchExporterOptions &options) + : options_{options}, http_client_{ext::http::client::HttpClientFactory::Create()} #ifdef ENABLE_ASYNC_EXPORT , @@ -301,11 +306,6 @@ ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter() #endif } -ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter( - const ElasticsearchExporterOptions &options) - : options_{options}, http_client_{ext::http::client::HttpClientFactory::Create()} -{} - std::unique_ptr ElasticsearchLogRecordExporter::MakeRecordable() noexcept { return std::unique_ptr(new ElasticSearchRecordable());