diff --git a/exporters/elasticsearch/src/es_log_exporter.cc b/exporters/elasticsearch/src/es_log_exporter.cc index 3d7ee72949..13798ae300 100644 --- a/exporters/elasticsearch/src/es_log_exporter.cc +++ b/exporters/elasticsearch/src/es_log_exporter.cc @@ -35,10 +35,10 @@ class ResponseHandler : public http_client::EventHandler const std::string &body) noexcept { std::stringstream ss; - ss << "Status:" << response.GetStatusCode() << "Header:"; + ss << "Status:" << response.GetStatusCode() << ", Header:"; response.ForEachHeader([&ss](opentelemetry::nostd::string_view header_name, opentelemetry::nostd::string_view header_value) { - ss << "\t" << header_name.data() << " : " << header_value.data() << ","; + ss << "\t" << header_name.data() << ": " << header_value.data() << ","; return true; }); ss << "Body:" << body; diff --git a/exporters/otlp/src/otlp_http_client.cc b/exporters/otlp/src/otlp_http_client.cc index b64ebb16d1..8ea20919df 100644 --- a/exporters/otlp/src/otlp_http_client.cc +++ b/exporters/otlp/src/otlp_http_client.cc @@ -83,10 +83,10 @@ class ResponseHandler : public http_client::EventHandler const std::string &body) noexcept { std::stringstream ss; - ss << "Status:" << response.GetStatusCode() << "Header:"; + ss << "Status:" << response.GetStatusCode() << ", Header:"; response.ForEachHeader([&ss](opentelemetry::nostd::string_view header_name, opentelemetry::nostd::string_view header_value) { - ss << "\t" << header_name.data() << " : " << header_value.data() << ","; + ss << "\t" << header_name.data() << ": " << header_value.data() << ","; return true; }); ss << "Body:" << body; @@ -116,8 +116,7 @@ class ResponseHandler : public http_client::EventHandler OTEL_INTERNAL_LOG_ERROR("OTLP HTTP Client] Export failed, " << log_message); result = sdk::common::ExportResult::kFailure; } - - if (console_debug_) + else if (console_debug_) { if (log_message.empty()) {