From a0eb5b667fd1e68edf71d9ce566db81852c83971 Mon Sep 17 00:00:00 2001 From: Gordon Brown Date: Wed, 26 Jan 2022 00:54:37 -0700 Subject: [PATCH] Always emit product origin to deprecation log if present (#83115) Prior to this commit, we only emit the product origin to the deprecation log if there's an opaque ID present. This is very counterintuitive, and probably not intentional given that it doesn't match the behavior in master. This commit changes the behavior so that the product origin will always be included in the deprecation log JSON if it's present in the context of the request. --- .../org/elasticsearch/common/logging/DeprecatedMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/common/logging/DeprecatedMessage.java b/server/src/main/java/org/elasticsearch/common/logging/DeprecatedMessage.java index 7a06db1ed64b1..75bacfb1ad672 100644 --- a/server/src/main/java/org/elasticsearch/common/logging/DeprecatedMessage.java +++ b/server/src/main/java/org/elasticsearch/common/logging/DeprecatedMessage.java @@ -49,7 +49,7 @@ private static Map fieldMap(DeprecationCategory category, String if (Strings.isNullOrEmpty(xOpaqueId) == false) { builder.put(X_OPAQUE_ID_FIELD_NAME, xOpaqueId); } - if (Strings.isNullOrEmpty(xOpaqueId) == false) { + if (Strings.isNullOrEmpty(productOrigin) == false) { builder.put(ELASTIC_ORIGIN_FIELD_NAME, productOrigin); } return builder.immutableMap();