diff --git a/distribution/src/config/log4j2.properties b/distribution/src/config/log4j2.properties index c57af926618a..0e834735e976 100644 --- a/distribution/src/config/log4j2.properties +++ b/distribution/src/config/log4j2.properties @@ -93,7 +93,7 @@ appender.deprecation_rolling_old.strategy.type = DefaultRolloverStrategy appender.deprecation_rolling_old.strategy.max = 4 ################################################# logger.deprecation.name = org.elasticsearch.deprecation -logger.deprecation.level = deprecation +logger.deprecation.level = WARN logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling logger.deprecation.appenderRef.deprecation_rolling_old.ref = deprecation_rolling_old logger.deprecation.appenderRef.header_warning.ref = header_warning diff --git a/docs/reference/setup/logging-config.asciidoc b/docs/reference/setup/logging-config.asciidoc index 467e1f561ba9..edf4f05a2920 100644 --- a/docs/reference/setup/logging-config.asciidoc +++ b/docs/reference/setup/logging-config.asciidoc @@ -200,12 +200,12 @@ By default, {es} rolls and compresses deprecation logs at 1GB. The default configuration preserves a maximum of five log files: four rolled logs and an active log. -{es} emits deprecation log messages at the `DEPRECATION` level. To stop writing -deprecation log messages, set `logger.deprecation.level` to `error`: +{es} emits deprecation log messages at the `CRITICAL` level. To stop writing +deprecation log messages, set `logger.deprecation.level` to `OFF`: [source,properties] ---- -logger.deprecation.level = error +logger.deprecation.level = OFF ---- You can identify what is triggering deprecated functionality if `X-Opaque-Id` was used as an HTTP header. diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CJKBigramFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CJKBigramFilterFactory.java index e86844ab9470..1a35e7885a34 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CJKBigramFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CJKBigramFilterFactory.java @@ -92,7 +92,7 @@ public final class CJKBigramFilterFactory extends AbstractTokenFilterFactory { "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); } } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java index a2cae9a44857..af36cf4dbe2b 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonAnalysisPlugin.java @@ -239,7 +239,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri filters.put("dutch_stem", DutchStemTokenFilterFactory::new); filters.put("edge_ngram", EdgeNGramTokenFilterFactory::new); filters.put("edgeNGram", (IndexSettings indexSettings, Environment environment, String name, Settings settings) -> { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "edgeNGram_deprecation", "The [edgeNGram] token filter name is deprecated and will be removed in a future version. " + "Please change the filter name to [edge_ngram] instead."); return new EdgeNGramTokenFilterFactory(indexSettings, environment, name, settings); @@ -264,7 +264,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri filters.put("multiplexer", MultiplexerTokenFilterFactory::new); filters.put("ngram", NGramTokenFilterFactory::new); filters.put("nGram", (IndexSettings indexSettings, Environment environment, String name, Settings settings) -> { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "nGram_deprecation", "The [nGram] token filter name is deprecated and will be removed in a future version. " + "Please change the filter name to [ngram] instead."); return new NGramTokenFilterFactory(indexSettings, environment, name, settings); @@ -313,7 +313,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri tokenizers.put("thai", ThaiTokenizerFactory::new); tokenizers.put("nGram", (IndexSettings indexSettings, Environment environment, String name, Settings settings) -> { if (indexSettings.getIndexVersionCreated().onOrAfter(org.elasticsearch.Version.V_7_6_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation", "The [nGram] tokenizer name is deprecated and will be removed in a future version. " + "Please change the tokenizer name to [ngram] instead."); } @@ -322,7 +322,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri tokenizers.put("ngram", NGramTokenizerFactory::new); tokenizers.put("edgeNGram", (IndexSettings indexSettings, Environment environment, String name, Settings settings) -> { if (indexSettings.getIndexVersionCreated().onOrAfter(org.elasticsearch.Version.V_7_6_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation", "The [edgeNGram] tokenizer name is deprecated and will be removed in a future version. " + "Please change the tokenizer name to [edge_ngram] instead."); } @@ -403,7 +403,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri filters.add(PreConfiguredCharFilter.singleton("html_strip", false, HTMLStripCharFilter::new)); filters.add(PreConfiguredCharFilter.elasticsearchVersion("htmlStrip", false, (reader, version) -> { if (version.onOrAfter(org.elasticsearch.Version.V_6_3_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "htmlStrip_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "htmlStrip_deprecation", "The [htmpStrip] char filter name is deprecated and will be removed in a future version. " + "Please change the filter name to [html_strip] instead."); } @@ -434,7 +434,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri "[delimited_payload_filter] is not supported for new indices, use [delimited_payload] instead"); } if (version.onOrAfter(Version.V_6_2_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "analysis_delimited_payload_filter", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "analysis_delimited_payload_filter", "Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"); } return new DelimitedPayloadTokenFilter(input, @@ -454,7 +454,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri "The [edgeNGram] token filter name was deprecated in 6.4 and cannot be used in new indices. " + "Please change the filter name to [edge_ngram] instead."); } else { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "edgeNGram_deprecation", "The [edgeNGram] token filter name is deprecated and will be removed in a future version. " + "Please change the filter name to [edge_ngram] instead."); } @@ -481,7 +481,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri throw new IllegalArgumentException("The [nGram] token filter name was deprecated in 6.4 and cannot be used in new indices. " + "Please change the filter name to [ngram] instead."); } else { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "nGram_deprecation", "The [nGram] token filter name is deprecated and will be removed in a future version. " + "Please change the filter name to [ngram] instead."); } @@ -559,7 +559,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri // Temporary shim for aliases. TODO deprecate after they are moved tokenizers.add(PreConfiguredTokenizer.elasticsearchVersion("nGram", (version) -> { if (version.onOrAfter(org.elasticsearch.Version.V_7_6_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation", "The [nGram] tokenizer name is deprecated and will be removed in a future version. " + "Please change the tokenizer name to [ngram] instead."); } @@ -567,7 +567,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri })); tokenizers.add(PreConfiguredTokenizer.elasticsearchVersion("edgeNGram", (version) -> { if (version.onOrAfter(org.elasticsearch.Version.V_7_6_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation", "The [edgeNGram] tokenizer name is deprecated and will be removed in a future version. " + "Please change the tokenizer name to [edge_ngram] instead."); } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonGramsTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonGramsTokenFilterFactory.java index 35204bd521a6..54fd8e33888e 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonGramsTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/CommonGramsTokenFilterFactory.java @@ -59,7 +59,7 @@ public class CommonGramsTokenFilterFactory extends AbstractTokenFilterFactory { if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_0_0)) { throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/EdgeNGramTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/EdgeNGramTokenFilterFactory.java index 617b460fb331..998c09175219 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/EdgeNGramTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/EdgeNGramTokenFilterFactory.java @@ -81,7 +81,7 @@ public class EdgeNGramTokenFilterFactory extends AbstractTokenFilterFactory { throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return this; } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintTokenFilterFactory.java index 22510e7d5c3b..28fc5396ad62 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintTokenFilterFactory.java @@ -48,7 +48,7 @@ public class FingerprintTokenFilterFactory extends AbstractTokenFilterFactory { throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return this; } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/LegacyDelimitedPayloadTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/LegacyDelimitedPayloadTokenFilterFactory.java index 7fe4ad7d0b64..0f74f8cc8cd1 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/LegacyDelimitedPayloadTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/LegacyDelimitedPayloadTokenFilterFactory.java @@ -27,7 +27,7 @@ public class LegacyDelimitedPayloadTokenFilterFactory extends DelimitedPayloadTo "[delimited_payload_filter] is not supported for new indices, use [delimited_payload] instead"); } if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_6_2_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "analysis_legacy_delimited_payload_filter", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "analysis_legacy_delimited_payload_filter", "Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"); } } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/MultiplexerTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/MultiplexerTokenFilterFactory.java index de5f9508a2f2..716bfc95f2a7 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/MultiplexerTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/MultiplexerTokenFilterFactory.java @@ -56,7 +56,7 @@ public class MultiplexerTokenFilterFactory extends AbstractTokenFilterFactory { } else { if (preserveOriginal) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return IDENTITY_FILTER; } @@ -119,7 +119,7 @@ public class MultiplexerTokenFilterFactory extends AbstractTokenFilterFactory { } else { if (preserveOriginal) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return IDENTITY_FILTER; } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/NGramTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/NGramTokenFilterFactory.java index 8c4d1a198387..48205e354c8b 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/NGramTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/NGramTokenFilterFactory.java @@ -42,7 +42,7 @@ public class NGramTokenFilterFactory extends AbstractTokenFilterFactory { + maxAllowedNgramDiff + "] but was [" + ngramDiff + "]. This limit can be set by changing the [" + IndexSettings.MAX_NGRAM_DIFF_SETTING.getKey() + "] index level setting."); } else { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "ngram_big_difference", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "ngram_big_difference", "Deprecated big difference between max_gram and min_gram in NGram Tokenizer," + "expected difference must be less than or equal to: [" + maxAllowedNgramDiff + "]"); } @@ -61,7 +61,7 @@ public class NGramTokenFilterFactory extends AbstractTokenFilterFactory { throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return this; } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/NGramTokenizerFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/NGramTokenizerFactory.java index 641d68f354cc..0fc68c3164f1 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/NGramTokenizerFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/NGramTokenizerFactory.java @@ -108,7 +108,7 @@ public class NGramTokenizerFactory extends AbstractTokenizerFactory { + maxAllowedNgramDiff + "] but was [" + ngramDiff + "]. This limit can be set by changing the [" + IndexSettings.MAX_NGRAM_DIFF_SETTING.getKey() + "] index level setting."); } else { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "ngram_big_difference", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "ngram_big_difference", "Deprecated big difference between max_gram and min_gram in NGram Tokenizer," + "expected difference must be less than or equal to: [" + maxAllowedNgramDiff + "]"); } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/StandardHtmlStripAnalyzerProvider.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/StandardHtmlStripAnalyzerProvider.java index 6b74c7a60f25..522d0a141acf 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/StandardHtmlStripAnalyzerProvider.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/StandardHtmlStripAnalyzerProvider.java @@ -38,7 +38,7 @@ public class StandardHtmlStripAnalyzerProvider extends AbstractIndexAnalyzerProv throw new IllegalArgumentException("[standard_html_strip] analyzer is not supported for new indices, " + "use a custom analyzer using [standard] tokenizer and [html_strip] char_filter, plus [lowercase] filter"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "standard_html_strip_deprecation", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "standard_html_strip_deprecation", "Deprecated analyzer [standard_html_strip] used, " + "replace it with a custom analyzer using [standard] tokenizer and [html_strip] char_filter, plus [lowercase] filter"); } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/SynonymTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/SynonymTokenFilterFactory.java index b02834e37885..feeea15589dc 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/SynonymTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/SynonymTokenFilterFactory.java @@ -47,7 +47,7 @@ public class SynonymTokenFilterFactory extends AbstractTokenFilterFactory { this.settings = settings; if (settings.get("ignore_case") != null) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_ignore_case_option", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_ignore_case_option", "The ignore_case option on the synonym_graph filter is deprecated. " + "Instead, insert a lowercase filter in the filter chain before the synonym_graph filter."); } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/WordDelimiterGraphTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/WordDelimiterGraphTokenFilterFactory.java index 7747f21f4566..b7e130d77d93 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/WordDelimiterGraphTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/WordDelimiterGraphTokenFilterFactory.java @@ -102,7 +102,7 @@ public class WordDelimiterGraphTokenFilterFactory extends AbstractTokenFilterFac throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return this; } diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/WordDelimiterTokenFilterFactory.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/WordDelimiterTokenFilterFactory.java index bc8db9bd3cfc..b0510bef5bd7 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/WordDelimiterTokenFilterFactory.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/WordDelimiterTokenFilterFactory.java @@ -105,7 +105,7 @@ public class WordDelimiterTokenFilterFactory extends AbstractTokenFilterFactory throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return this; } diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java index 157a308b5d17..731fb020469c 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java @@ -45,7 +45,7 @@ public final class ScriptProcessor extends AbstractProcessor { DeprecationLogger.getLogger(DynamicMap.class); private static final Map> PARAMS_FUNCTIONS = org.elasticsearch.core.Map.of( "_type", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "script_processor", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "script_processor", "[types removal] Looking up doc types [_type] in scripts is deprecated."); return value; }); diff --git a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java index 4506f8cf7276..e06c499d0ef0 100644 --- a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java +++ b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java @@ -330,7 +330,7 @@ public class UserAgentProcessor extends AbstractProcessor { } if (useECS == false) { - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ecs_false_non_common_schema", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "ecs_false_non_common_schema", "setting [ecs] to false for non-common schema " + "format is deprecated and will be removed in 8.0, set to true or remove to use the non-deprecated format"); } @@ -383,7 +383,7 @@ public class UserAgentProcessor extends AbstractProcessor { Property value = valueOf(propertyName.toUpperCase(Locale.ROOT)); if (DEPRECATED_PROPERTIES.contains(value)) { final String key = "user_agent_processor_property_" + propertyName.replaceAll("[^\\w_]+", "_"); - deprecationLogger.deprecate(DeprecationCategory.PARSING, key, + deprecationLogger.critical(DeprecationCategory.PARSING, key, "the [{}] property is deprecated for the user-agent processor", propertyName); } return value; diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java index 89499747fdbe..672e9d73ad62 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java @@ -74,7 +74,7 @@ public class RestMultiSearchTemplateAction extends BaseRestHandler { // Emit a single deprecation message if any search template contains types. for (SearchTemplateRequest searchTemplateRequest : multiRequest.requests()) { if (searchTemplateRequest.getRequest().types().length > 0) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "msearch_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "msearch_with_types", TYPES_DEPRECATION_MESSAGE); break; } } diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java index 4178e0861367..11d5c60924a7 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java @@ -131,7 +131,7 @@ public class HasChildQueryBuilder extends AbstractQueryBuilder docs = new ArrayList<>(); String type = context.getType(); if (documentType != null) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "percolate_with_document_type", DOCUMENT_TYPE_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "percolate_with_document_type", DOCUMENT_TYPE_DEPRECATION_MESSAGE); if (documentType.equals(type) == false) { throw new IllegalArgumentException("specified document_type [" + documentType + "] is not equal to the actual type [" + type + "]"); diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexValidator.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexValidator.java index adb10be5f266..242b1f286bec 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexValidator.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexValidator.java @@ -56,7 +56,7 @@ public class ReindexValidator { state); SearchSourceBuilder searchSource = request.getSearchRequest().source(); if (searchSource != null && searchSource.sorts() != null && searchSource.sorts().isEmpty() == false) { - deprecationLogger.deprecate(DeprecationCategory.API, "reindex_sort", SORT_DEPRECATED_MESSAGE); + deprecationLogger.critical(DeprecationCategory.API, "reindex_sort", SORT_DEPRECATED_MESSAGE); } } diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/remote/RemoteRequestBuilders.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/remote/RemoteRequestBuilders.java index 0a2d97ab60c7..9d223e93c91c 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/remote/RemoteRequestBuilders.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/remote/RemoteRequestBuilders.java @@ -174,7 +174,7 @@ final class RemoteRequestBuilders { private static String encodeIndex(String s) { if (s.contains("%")) { // already encoded, pass-through to allow this in mixed version clusters checkIndexOrType("Index", s); - DEPRECATION_LOGGER.deprecate(DeprecationCategory.API, "reindex_url_encoded_index", DEPRECATED_URL_ENCODED_INDEX_WARNING); + DEPRECATION_LOGGER.critical(DeprecationCategory.API, "reindex_url_encoded_index", DEPRECATED_URL_ENCODED_INDEX_WARNING); return s; } try { diff --git a/plugins/analysis-icu/src/main/java/org/elasticsearch/index/analysis/IcuNormalizerTokenFilterFactory.java b/plugins/analysis-icu/src/main/java/org/elasticsearch/index/analysis/IcuNormalizerTokenFilterFactory.java index 54d4e06957de..ad22e294e91f 100644 --- a/plugins/analysis-icu/src/main/java/org/elasticsearch/index/analysis/IcuNormalizerTokenFilterFactory.java +++ b/plugins/analysis-icu/src/main/java/org/elasticsearch/index/analysis/IcuNormalizerTokenFilterFactory.java @@ -50,7 +50,7 @@ public class IcuNormalizerTokenFilterFactory extends AbstractTokenFilterFactory String unicodeSetFilter = settings.get("unicodeSetFilter"); if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_0_0)) { if (unicodeSetFilter != null) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "icu_normalizer_unicode_set_filter", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "icu_normalizer_unicode_set_filter", "[unicodeSetFilter] has been deprecated in favor of [unicode_set_filter]"); } else { unicodeSetFilter = settings.get("unicode_set_filter"); diff --git a/plugins/analysis-phonetic/src/main/java/org/elasticsearch/plugin/analysis/phonetic/PhoneticTokenFilterFactory.java b/plugins/analysis-phonetic/src/main/java/org/elasticsearch/plugin/analysis/phonetic/PhoneticTokenFilterFactory.java index f6d675b881af..713e9d5a5a55 100644 --- a/plugins/analysis-phonetic/src/main/java/org/elasticsearch/plugin/analysis/phonetic/PhoneticTokenFilterFactory.java +++ b/plugins/analysis-phonetic/src/main/java/org/elasticsearch/plugin/analysis/phonetic/PhoneticTokenFilterFactory.java @@ -140,7 +140,7 @@ public class PhoneticTokenFilterFactory extends AbstractTokenFilterFactory { throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return this; } diff --git a/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/plugin/discovery/azure/classic/AzureDiscoveryPlugin.java b/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/plugin/discovery/azure/classic/AzureDiscoveryPlugin.java index 328d89c1f69e..5fb40703288b 100644 --- a/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/plugin/discovery/azure/classic/AzureDiscoveryPlugin.java +++ b/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/plugin/discovery/azure/classic/AzureDiscoveryPlugin.java @@ -38,7 +38,7 @@ public class AzureDiscoveryPlugin extends Plugin implements DiscoveryPlugin { public AzureDiscoveryPlugin(Settings settings) { this.settings = settings; - deprecationLogger.deprecate(DeprecationCategory.PLUGINS, "azure_discovery_plugin", "azure classic discovery plugin is deprecated."); + deprecationLogger.critical(DeprecationCategory.PLUGINS, "azure_discovery_plugin", "azure classic discovery plugin is deprecated."); logger.trace("starting azure classic discovery plugin..."); } diff --git a/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java b/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java index 370d8d4651ba..83949291760c 100644 --- a/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java +++ b/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/Ec2ClientSettings.java @@ -125,12 +125,12 @@ final class Ec2ClientSettings { return null; } else { if (key.length() == 0) { - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ec2_invalid_settings", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "ec2_invalid_settings", "Setting [{}] is set but [{}] is not, which will be unsupported in future", SECRET_KEY_SETTING.getKey(), ACCESS_KEY_SETTING.getKey()); } if (secret.length() == 0) { - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ec2_invalid_settings", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "ec2_invalid_settings", "Setting [{}] is set but [{}] is not, which will be unsupported in future", ACCESS_KEY_SETTING.getKey(), SECRET_KEY_SETTING.getKey()); } diff --git a/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java index b472a24d3fda..d41a56fdf7f8 100644 --- a/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java +++ b/plugins/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3Repository.java @@ -244,7 +244,7 @@ class S3Repository extends MeteredBlobStoreRepository { if (S3ClientSettings.checkDeprecatedCredentials(metadata.settings())) { // provided repository settings - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "s3_repository_secret_settings", + deprecationLogger.critical(DeprecationCategory.SECURITY, "s3_repository_secret_settings", "Using s3 access/secret key from repository settings. Instead " + "store these in named clients and the elasticsearch keystore for secure settings."); } diff --git a/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java b/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java index 1ec09ae8a253..0f6bde6d45e8 100644 --- a/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java +++ b/qa/evil-tests/src/test/java/org/elasticsearch/common/logging/EvilLoggerTests.java @@ -21,10 +21,10 @@ import org.apache.lucene.util.Constants; import org.elasticsearch.cli.UserException; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.Randomness; -import org.elasticsearch.core.PathUtils; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; +import org.elasticsearch.core.PathUtils; import org.elasticsearch.env.Environment; import org.elasticsearch.node.Node; import org.elasticsearch.test.ESTestCase; @@ -46,7 +46,6 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.IntStream; -import static org.elasticsearch.common.logging.DeprecationLogger.DEPRECATION; import static org.hamcrest.Matchers.endsWith; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; @@ -117,7 +116,7 @@ public class EvilLoggerTests extends ESTestCase { } for (int j = 0; j < iterations; j++) { for (final Integer id : ids) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, Integer.toString(id), + deprecationLogger.critical(DeprecationCategory.OTHER, Integer.toString(id), "This is a maybe logged deprecation message" + id); } } @@ -166,8 +165,8 @@ public class EvilLoggerTests extends ESTestCase { for (int i = 0; i < 128; i++) { assertLogLine( deprecationEvents.get(i), - DEPRECATION, - "org.elasticsearch.common.logging.DeprecationLogger.deprecate", + DeprecationLogger.CRITICAL, + "org.elasticsearch.common.logging.DeprecationLogger.logDeprecation", "This is a maybe logged deprecation message" + i); } @@ -199,8 +198,8 @@ public class EvilLoggerTests extends ESTestCase { assertThat(deprecationEvents.size(), equalTo(1)); assertLogLine( deprecationEvents.get(0), - DEPRECATION, - "org.elasticsearch.common.logging.DeprecationLogger.deprecate", + DeprecationLogger.CRITICAL, + "org.elasticsearch.common.logging.DeprecationLogger.logDeprecation", "\\[deprecated.foo\\] setting was deprecated in Elasticsearch and will be removed in a future release! " + "See the breaking changes documentation for the next major version."); } diff --git a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java index c864d2125f15..6ea8becf9812 100644 --- a/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java +++ b/qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java @@ -47,7 +47,8 @@ import static org.hamcrest.core.IsEqual.equalTo; /** * This test confirms JSON log structure is properly formatted and can be parsed. - * It has to be in a org.elasticsearch.common.logging package to use PrefixLogger + * It has to be in a org.elasticsearch.common.logging package to use PrefixLogger. + * When running from IDE set -Dtests.security.manager=false */ public class JsonLoggerTests extends ESTestCase { @@ -73,6 +74,54 @@ public class JsonLoggerTests extends ESTestCase { super.tearDown(); } + public void testDeprecationWarnMessage() throws IOException { + final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test"); + + testLogger.warn(DeprecationCategory.OTHER, "a key", "deprecated warn message1"); + + final Path path = PathUtils.get(System.getProperty("es.logs.base_path"), + System.getProperty("es.logs.cluster_name") + "_deprecated.json"); + + try (Stream> stream = JsonLogsStream.mapStreamFrom(path)) { + List> jsonLogs = stream + .collect(Collectors.toList()); + + assertThat(jsonLogs, contains( + allOf( + hasEntry("level", "WARN"), + hasEntry("component", "o.e.d.test"), + hasEntry("message", "deprecated warn message1") + )) + ); + } + + assertWarnings("deprecated warn message1"); + } + + public void testDeprecatedMessageWithoutXOpaqueId() throws IOException { + final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test"); + testLogger.critical(DeprecationCategory.OTHER, "a key", "deprecated message1"); + + final Path path = PathUtils.get(System.getProperty("es.logs.base_path"), + System.getProperty("es.logs.cluster_name") + "_deprecated.json"); + try (Stream> stream = JsonLogsStream.mapStreamFrom(path)) { + List> jsonLogs = stream + .collect(Collectors.toList()); + + assertThat(jsonLogs, contains( + allOf( + hasEntry("type", "deprecation.elasticsearch"), + hasEntry("level", "CRITICAL"), + hasEntry("component", "o.e.d.test"), + hasEntry("cluster.name", "elasticsearch"), + hasEntry("node.name", "sample-name"), + hasEntry("message", "deprecated message1"), + not(hasKey("x-opaque-id")) + ) + )); + } + assertWarnings("deprecated message1"); + } public void testParseFieldEmittingDeprecatedLogs() throws Exception { @@ -100,7 +149,7 @@ public class JsonLoggerTests extends ESTestCase { // deprecation log for field deprecated_name allOf( hasEntry("type", "deprecation.elasticsearch"), - hasEntry("level", "DEPRECATION"), + hasEntry("level", "CRITICAL"), hasEntry("component", "o.e.d.c.x.ParseField"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -111,7 +160,7 @@ public class JsonLoggerTests extends ESTestCase { ), allOf( hasEntry("type", "deprecation.elasticsearch"), - hasEntry("level", "DEPRECATION"), + hasEntry("level", "CRITICAL"), hasEntry("component", "o.e.d.c.x.ParseField"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -135,7 +184,7 @@ public class JsonLoggerTests extends ESTestCase { threadContext.putHeader(Task.X_OPAQUE_ID, "someId"); threadContext.putHeader(Task.TRACE_ID, "someTraceId"); final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test"); - testLogger.deprecate(DeprecationCategory.OTHER, "someKey", "deprecated message1"); + testLogger.critical(DeprecationCategory.OTHER, "someKey", "deprecated message1"); final Path path = PathUtils.get( System.getProperty("es.logs.base_path"), @@ -150,7 +199,7 @@ public class JsonLoggerTests extends ESTestCase { contains( allOf( hasEntry("type", "deprecation.elasticsearch"), - hasEntry("level", "DEPRECATION"), + hasEntry("level", "CRITICAL"), hasEntry("component", "o.e.d.test"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -166,31 +215,6 @@ public class JsonLoggerTests extends ESTestCase { }); } - public void testDeprecatedMessageWithoutXOpaqueId() throws IOException { - final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test"); - testLogger.deprecate(DeprecationCategory.OTHER, "a key", "deprecated message1"); - - final Path path = PathUtils.get(System.getProperty("es.logs.base_path"), - System.getProperty("es.logs.cluster_name") + "_deprecated.json"); - try (Stream> stream = JsonLogsStream.mapStreamFrom(path)) { - List> jsonLogs = stream - .collect(Collectors.toList()); - - assertThat(jsonLogs, contains( - allOf( - hasEntry("type", "deprecation.elasticsearch"), - hasEntry("level", "DEPRECATION"), - hasEntry("component", "o.e.d.test"), - hasEntry("cluster.name", "elasticsearch"), - hasEntry("node.name", "sample-name"), - hasEntry("message", "deprecated message1"), - not(hasKey("x-opaque-id")) - ) - )); - } - assertWarnings("deprecated message1"); - } - public void testJsonLayout() throws IOException { final Logger testLogger = LogManager.getLogger("test"); @@ -303,15 +327,14 @@ public class JsonLoggerTests extends ESTestCase { } } - public void testDuplicateLogMessages() throws Exception { final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger("org.elasticsearch.test"); // For the same key and X-Opaque-ID deprecation should be once withThreadContext(threadContext -> { threadContext.putHeader(Task.X_OPAQUE_ID, "ID1"); - deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message1"); - deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message2"); + deprecationLogger.critical(DeprecationCategory.OTHER, "key", "message1"); + deprecationLogger.critical(DeprecationCategory.OTHER, "key", "message2"); assertWarnings("message1", "message2"); final Path path = PathUtils.get(System.getProperty("es.logs.base_path"), @@ -323,7 +346,7 @@ public class JsonLoggerTests extends ESTestCase { assertThat(jsonLogs, contains( allOf( hasEntry("type", "deprecation.elasticsearch"), - hasEntry("level", "DEPRECATION"), + hasEntry("level", "CRITICAL"), hasEntry("component", "o.e.d.test"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -341,8 +364,8 @@ public class JsonLoggerTests extends ESTestCase { //continuing with message1-ID1 in logs already, adding a new deprecation log line with message2-ID2 withThreadContext(threadContext -> { threadContext.putHeader(Task.X_OPAQUE_ID, "ID2"); - deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message1"); - deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message2"); + deprecationLogger.critical(DeprecationCategory.OTHER, "key", "message1"); + deprecationLogger.critical(DeprecationCategory.OTHER, "key", "message2"); assertWarnings("message1", "message2"); final Path path = PathUtils.get( @@ -357,7 +380,7 @@ public class JsonLoggerTests extends ESTestCase { contains( allOf( hasEntry("type", "deprecation.elasticsearch"), - hasEntry("level", "DEPRECATION"), + hasEntry("level", "CRITICAL"), hasEntry("component", "o.e.d.test"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), @@ -366,7 +389,7 @@ public class JsonLoggerTests extends ESTestCase { ), allOf( hasEntry("type", "deprecation.elasticsearch"), - hasEntry("level", "DEPRECATION"), + hasEntry("level", "CRITICAL"), hasEntry("component", "o.e.d.test"), hasEntry("cluster.name", "elasticsearch"), hasEntry("node.name", "sample-name"), diff --git a/qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties b/qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties index bb16cf3f90e7..91395921cecc 100644 --- a/qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties +++ b/qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties @@ -47,7 +47,7 @@ appender.header_warning.type = HeaderWarningAppender appender.header_warning.name = header_warning logger.deprecation.name = org.elasticsearch.deprecation -logger.deprecation.level = deprecation +logger.deprecation.level = WARN logger.deprecation.appenderRef.console.ref = console logger.deprecation.appenderRef.file.ref = file logger.deprecation.appenderRef.deprecation_rolling.ref = deprecated diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java index fa73d9ef54b3..b01cc4f463d6 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SystemIndicesSnapshotIT.java @@ -364,7 +364,7 @@ public class SystemIndicesSnapshotIT extends AbstractSnapshotIntegTestCase { new MockLogAppender.SeenEventExpectation( "restore-system-index-from-snapshot", "org.elasticsearch.deprecation.snapshots.RestoreService", - DeprecationLogger.DEPRECATION, + DeprecationLogger.CRITICAL, "Restoring system indices by name is deprecated. Use feature states instead. System indices: [.test-system-idx]" ) ); diff --git a/server/src/main/java/org/elasticsearch/action/ActionModule.java b/server/src/main/java/org/elasticsearch/action/ActionModule.java index 69eff05e3049..c813e80a1f94 100644 --- a/server/src/main/java/org/elasticsearch/action/ActionModule.java +++ b/server/src/main/java/org/elasticsearch/action/ActionModule.java @@ -472,7 +472,7 @@ public class ActionModule extends AbstractModule { } restWrapper = newRestWrapper; if ("org.elasticsearch.xpack.security.Security".equals(plugin.getClass().getCanonicalName()) == false) { - deprecationLogger.deprecate(DeprecationCategory.PLUGINS, "3rd_party_rest_deprecation", "The " + + deprecationLogger.critical(DeprecationCategory.PLUGINS, "3rd_party_rest_deprecation", "The " + plugin.getClass().getName() + " plugin installs a custom REST wrapper. This functionality is deprecated and will " + "not be possible in Elasticsearch 8.0. If this plugin is intended to provide security features for Elasticsearch " + "then you should switch to using the built-in Elasticsearch features instead."); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java index 007bf160300f..74da16062541 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java @@ -72,7 +72,7 @@ public class AddVotingConfigExclusionsRequest extends MasterNodeRequest 0) { - deprecationLogger.deprecate(DeprecationCategory.API, "voting_config_exclusion", DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.API, "voting_config_exclusion", DEPRECATION_MESSAGE); } this.nodeDescriptions = nodeDescriptions; @@ -94,7 +94,7 @@ public class AddVotingConfigExclusionsRequest extends MasterNodeRequest 0) { - deprecationLogger.deprecate(DeprecationCategory.API, "voting_config_exclusion", + deprecationLogger.critical(DeprecationCategory.API, "voting_config_exclusion", "nodeDescription is deprecated and will be removed, use nodeIds or nodeNames instead"); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java index 9d1888e72f7c..2d8a67420002 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java @@ -530,7 +530,7 @@ public class RestoreSnapshotRequest extends MasterNodeRequest "[" + entry.getKey() + "] -> " + entry.getValue()) .collect(Collectors.joining(", ")) + ". This will not work in the next major version"; - deprecationLogger.deprecate(DeprecationCategory.API, "open_system_index_access", message); + deprecationLogger.critical(DeprecationCategory.API, "open_system_index_access", message); } final List hiddenSystemIndexViolations diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java index f3bcf2a937e5..9290a71bca2a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java @@ -326,7 +326,7 @@ public class PutIndexTemplateRequest extends MasterNodeRequest i termVectorsRequest.index = parser.text(); } else if (TYPE.match(currentFieldName, parser.getDeprecationHandler())) { termVectorsRequest.type = parser.text(); - deprecationLogger.deprecate(DeprecationCategory.TYPES, "termvectors_with_types", + deprecationLogger.critical(DeprecationCategory.TYPES, "termvectors_with_types", RestTermVectorsAction.TYPES_DEPRECATION_MESSAGE); } else if (ID.match(currentFieldName, parser.getDeprecationHandler())) { if (termVectorsRequest.doc != null) { diff --git a/server/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java b/server/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java index 3c92111d3af0..bdcb53757ed6 100644 --- a/server/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java +++ b/server/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java @@ -358,7 +358,7 @@ final class Bootstrap { + "requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. " + "If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.", System.getProperty("java.home")); - DeprecationLogger.getLogger(Bootstrap.class).deprecate(DeprecationCategory.OTHER, "java_version_11_required", message); + DeprecationLogger.getLogger(Bootstrap.class).critical(DeprecationCategory.OTHER, "java_version_11_required", message); } if (BootstrapInfo.getSystemProperties().get("es.xcontent.strict_duplicate_detection") != null) { final String message = String.format( @@ -366,7 +366,7 @@ final class Bootstrap { "The Java option es.xcontent.strict_duplicate_detection is set to [%s]; " + "this option is deprecated and non-functional and should be removed from Java configuration.", BootstrapInfo.getSystemProperties().get("es.xcontent.strict_duplicate_detection")); - DeprecationLogger.getLogger(Bootstrap.class).deprecate(DeprecationCategory.SETTINGS, + DeprecationLogger.getLogger(Bootstrap.class).critical(DeprecationCategory.SETTINGS, "strict_duplicate_detection_setting_removed", message); } if (environment.pidFile() != null) { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java index 8357ead1d9b5..b1bd5d727450 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java @@ -343,7 +343,7 @@ public class IndexNameExpressionResolver { if (resolvedSystemIndices.isEmpty() == false) { Collections.sort(resolvedSystemIndices); - deprecationLogger.deprecate(DeprecationCategory.API, "open_system_index_access", + deprecationLogger.critical(DeprecationCategory.API, "open_system_index_access", "this request accesses system indices: {}, but in a future major version, direct access to system " + "indices will be prevented by default", resolvedSystemIndices); } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java index 1c71f81ca4a3..58037038fd40 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetadata.java @@ -92,7 +92,7 @@ public class IndexTemplateMetadata extends AbstractDiffable 1) { - deprecationLogger.deprecate(DeprecationCategory.TEMPLATES, "index-templates", + deprecationLogger.critical(DeprecationCategory.TEMPLATES, "index-templates", "Index template {} contains multiple typed mappings; templates in 8x will only support a single mapping", name); } diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java index eb6124f403c6..0a704cd735d9 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataCreateIndexService.java @@ -208,7 +208,7 @@ public class MetadataCreateIndexService { } else if (isHidden) { logger.trace("index [{}] is a hidden index", index); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.INDICES, "index_name_starts_with_dot", + DEPRECATION_LOGGER.critical(DeprecationCategory.INDICES, "index_name_starts_with_dot", "index name [{}] starts with a dot '.', in the next major version, index names " + "starting with a dot are reserved for hidden indices and system indices", index); } @@ -366,7 +366,7 @@ public class MetadataCreateIndexService { request.index(), isHiddenFromRequest); if (v1Templates.size() > 1) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.TEMPLATES, "index_template_multiple_match", + DEPRECATION_LOGGER.critical(DeprecationCategory.TEMPLATES, "index_template_multiple_match", "index [{}] matches multiple legacy templates [{}], composable templates will only match a single template", request.index(), v1Templates.stream().map(IndexTemplateMetadata::name).sorted().collect(Collectors.joining(", "))); } @@ -844,7 +844,7 @@ public class MetadataCreateIndexService { */ shardLimitValidator.validateShardLimit(indexSettings, currentState); if (indexSettings.getAsBoolean(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true) == false) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.SETTINGS, "soft_deletes_disabled", + DEPRECATION_LOGGER.critical(DeprecationCategory.SETTINGS, "soft_deletes_disabled", "Creating indices with soft-deletes disabled is deprecated and will be removed in future Elasticsearch versions. " + "Please do not specify value for setting [index.soft_deletes.enabled] of index [" + request.index() + "]."); } @@ -1338,7 +1338,7 @@ public class MetadataCreateIndexService { if (IndexSettings.INDEX_SOFT_DELETES_SETTING.get(indexSettings) && (IndexSettings.INDEX_TRANSLOG_RETENTION_AGE_SETTING.exists(indexSettings) || IndexSettings.INDEX_TRANSLOG_RETENTION_SIZE_SETTING.exists(indexSettings))) { - DEPRECATION_LOGGER.deprecate( + DEPRECATION_LOGGER.critical( DeprecationCategory.SETTINGS, "translog_retention", "Translog retention settings [index.translog.retention.age] " @@ -1350,7 +1350,7 @@ public class MetadataCreateIndexService { public static void validateStoreTypeSetting(Settings indexSettings) { final String storeType = IndexModule.INDEX_STORE_TYPE_SETTING.get(indexSettings); if (IndexModule.Type.SIMPLEFS.match(storeType)) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.SETTINGS, "store_type_setting", + DEPRECATION_LOGGER.critical(DeprecationCategory.SETTINGS, "store_type_setting", "[simplefs] is deprecated and will be removed in 8.0. Use [niofs] or other file systems instead. " + "Elasticsearch 7.15 or later uses [niofs] for the [simplefs] store type as it offers superior " + "or equivalent performance to [simplefs]."); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/OperationRouting.java b/server/src/main/java/org/elasticsearch/cluster/routing/OperationRouting.java index 650b05b63cdb..b02ee9e2eca4 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/OperationRouting.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/OperationRouting.java @@ -56,7 +56,7 @@ public class OperationRouting { if (ignoreAwarenessAttr == false) { awarenessAttributes = AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING.get(settings); if (awarenessAttributes.isEmpty() == false) { - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "searches_not_routed_on_awareness_attributes", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "searches_not_routed_on_awareness_attributes", IGNORE_AWARENESS_ATTRIBUTES_DEPRECATION_MESSAGE); } clusterSettings.addSettingsUpdateConsumer(AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING, @@ -81,7 +81,7 @@ public class OperationRouting { boolean ignoreAwarenessAttr = parseBoolean(System.getProperty(IGNORE_AWARENESS_ATTRIBUTES_PROPERTY), false); if (ignoreAwarenessAttr == false) { if (this.awarenessAttributes.isEmpty() && awarenessAttributes.isEmpty() == false) { - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "searches_not_routed_on_awareness_attributes", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "searches_not_routed_on_awareness_attributes", IGNORE_AWARENESS_ATTRIBUTES_DEPRECATION_MESSAGE); } this.awarenessAttributes = awarenessAttributes; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java index db828c06f07b..0f03cd5e83b4 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdMonitor.java @@ -94,7 +94,7 @@ public class DiskThresholdMonitor { this.diskThresholdSettings = new DiskThresholdSettings(settings, clusterSettings); this.client = client; if (diskThresholdSettings.isAutoReleaseIndexEnabled() == false) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SETTINGS, DiskThresholdSettings.AUTO_RELEASE_INDEX_ENABLED_KEY.replace(".", "_"), "[{}] will be removed in version {}", @@ -319,7 +319,7 @@ public class DiskThresholdMonitor { logger.info("releasing read-only-allow-delete block on indices: [{}]", indicesToAutoRelease); updateIndicesReadOnly(indicesToAutoRelease, listener, false); } else { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SETTINGS, DiskThresholdSettings.AUTO_RELEASE_INDEX_ENABLED_KEY.replace(".", "_"), "[{}] will be removed in version {}", diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java index aaecc67832cd..f8c68894f82f 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java @@ -84,7 +84,7 @@ public class DiskThresholdDecider extends AllocationDecider { @Override public void validate(Boolean value, Map, Object> settings, boolean isPresent) { if (value == Boolean.FALSE && isPresent) { - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "watermark_enable_for_single_data_node", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "watermark_enable_for_single_data_node", "setting [{}=false] is deprecated and will not be available in a future version", ENABLE_FOR_SINGLE_DATA_NODE.getKey()); } diff --git a/server/src/main/java/org/elasticsearch/common/geo/SpatialStrategy.java b/server/src/main/java/org/elasticsearch/common/geo/SpatialStrategy.java index 14f9e56b8a7f..b7366c82e31b 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/SpatialStrategy.java +++ b/server/src/main/java/org/elasticsearch/common/geo/SpatialStrategy.java @@ -45,7 +45,7 @@ public enum SpatialStrategy implements Writeable { return strategy; } } - logger.deprecate(DeprecationCategory.OTHER, "geo_strategy", + logger.critical(DeprecationCategory.OTHER, "geo_strategy", "Unrecognised strategy [" + strategyName + "], falling back to [recursive]"); return null; } diff --git a/server/src/main/java/org/elasticsearch/common/joda/Joda.java b/server/src/main/java/org/elasticsearch/common/joda/Joda.java index fedd86628f9a..2acd7a76c7e2 100644 --- a/server/src/main/java/org/elasticsearch/common/joda/Joda.java +++ b/server/src/main/java/org/elasticsearch/common/joda/Joda.java @@ -65,7 +65,7 @@ public class Joda { String msg = "Camel case format name {} is deprecated and will be removed in a future version. " + "Use snake case name {} instead."; getDeprecationLogger() - .deprecate(DeprecationCategory.PARSING,"camelCaseDateFormat", msg, formatName.getCamelCaseName(), + .critical(DeprecationCategory.PARSING,"camelCaseDateFormat", msg, formatName.getCamelCaseName(), formatName.getSnakeCaseName()); } @@ -150,7 +150,7 @@ public class Joda { formatter = ISODateTimeFormat.weekDateTimeNoMillis(); } else if (FormatNames.WEEKYEAR.matches(input)) { getDeprecationLogger() - .deprecate(DeprecationCategory.PARSING, "week_year_format_name", + .critical(DeprecationCategory.PARSING, "week_year_format_name", "Format name \"week_year\" is deprecated and will be removed in a future version. Use \"weekyear\" format instead"); formatter = ISODateTimeFormat.weekyear(); } else if (FormatNames.WEEK_YEAR.matches(input)) { @@ -280,7 +280,7 @@ public class Joda { private static void maybeLogJodaDeprecation(String format) { if (JodaDeprecationPatterns.isDeprecatedPattern(format)) { String suggestion = JodaDeprecationPatterns.formatSuggestion(format); - getDeprecationLogger().deprecate(DeprecationCategory.PARSING, "joda-pattern-deprecation", + getDeprecationLogger().critical(DeprecationCategory.PARSING, "joda-pattern-deprecation", suggestion + " " + JodaDeprecationPatterns.USE_NEW_FORMAT_SPECIFIERS); } } @@ -390,11 +390,11 @@ public class Joda { long millis = new BigDecimal(text).longValue() * factor; // check for deprecations, but after it has parsed correctly so invalid values aren't counted as deprecated if (millis < 0) { - getDeprecationLogger().deprecate(DeprecationCategory.PARSING, "epoch-negative", "Use of negative values" + + getDeprecationLogger().critical(DeprecationCategory.PARSING, "epoch-negative", "Use of negative values" + " in epoch time formats is deprecated and will not be supported in the next major version of Elasticsearch."); } if (scientificNotation.matcher(text).find()) { - getDeprecationLogger().deprecate(DeprecationCategory.PARSING, "epoch-scientific-notation", + getDeprecationLogger().critical(DeprecationCategory.PARSING, "epoch-scientific-notation", "Use of scientific notation in epoch time formats is deprecated and will not be supported in the " + "next major version of Elasticsearch."); } diff --git a/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java b/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java index 1368e818ec80..82e4e2424036 100644 --- a/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java +++ b/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java @@ -13,12 +13,12 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; /** - * A logger that logs deprecation notices. Logger should be initialized with a parent logger which name will be used + * A logger that logs deprecation notices. Logger should be initialized with a class or name which will be used * for deprecation logger. For instance DeprecationLogger.getLogger("org.elasticsearch.test.SomeClass") will * result in a deprecation logger with name org.elasticsearch.deprecation.test.SomeClass. This allows to use a * deprecation logger defined in log4j2.properties. *

- * Logs are emitted at the custom {@link #DEPRECATION} level, and routed wherever they need to go using log4j. For example, + * Logs are emitted at the custom {@link #CRITICAL} level, and routed wherever they need to go using log4j. For example, * to disk using a rolling file appender, or added as a response header using {@link HeaderWarningAppender}. *

* Deprecation messages include a key, which is used for rate-limiting purposes. The log4j configuration @@ -27,18 +27,15 @@ import org.apache.logging.log4j.Logger; * message limiting. */ public class DeprecationLogger { - /** * Deprecation messages are logged at this level. + * More serious than WARN by 1, but less serious than ERROR */ - public static Level DEPRECATION = Level.forName("DEPRECATION", Level.WARN.intLevel() + 1); + public static Level CRITICAL = Level.forName("CRITICAL", Level.WARN.intLevel() - 1); + private final Logger logger; - private DeprecationLogger(Logger parentLogger) { - this.logger = parentLogger; - } - /** * Creates a new deprecation logger for the supplied class. Internally, it delegates to * {@link #getLogger(String)}, passing the full class name. @@ -76,17 +73,38 @@ public class DeprecationLogger { } /** - * Logs a message at the {@link #DEPRECATION} level. The message is also sent to the header warning logger, + * Logs a message at the {@link DeprecationLogger#CRITICAL} level. + * This log will indicate that a change will break in next version. + * The message is also sent to the header warning logger, * so that it can be returned to the client. */ - public DeprecationLogger deprecate( + public DeprecationLogger critical( final DeprecationCategory category, final String key, final String msg, - final Object... params - ) { + final Object... params) { + return logDeprecation(CRITICAL, category, key, msg, params); + } + + /** + * Logs a message at the {@link Level#WARN} level for less critical deprecations + * that won't break in next version. + * The message is also sent to the header warning logger, + * so that it can be returned to the client. + */ + public DeprecationLogger warn( + final DeprecationCategory category, + final String key, + final String msg, + final Object... params) { + return logDeprecation(Level.WARN, category, key, msg, params); + } + + private DeprecationLogger logDeprecation(Level level, DeprecationCategory category, String key, String msg, Object[] params) { ESLogMessage deprecationMessage = new DeprecatedMessage(category, key, HeaderWarning.getXOpaqueId(), msg, params); - logger.log(DEPRECATION, deprecationMessage); + logger.log(level, deprecationMessage); return this; } + + } diff --git a/server/src/main/java/org/elasticsearch/common/settings/Setting.java b/server/src/main/java/org/elasticsearch/common/settings/Setting.java index 22f515a8255c..5609e516be53 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/Setting.java +++ b/server/src/main/java/org/elasticsearch/common/settings/Setting.java @@ -565,7 +565,7 @@ public class Setting implements ToXContentObject { DeprecationCategory category = this.isSecure(settings) ? DeprecationCategory.SECURITY : DeprecationCategory.SETTINGS; Settings.DeprecationLoggerHolder.deprecationLogger - .deprecate(category, key, "[{}] setting was deprecated in Elasticsearch and will be removed in a future release! " + .critical(category, key, "[{}] setting was deprecated in Elasticsearch and will be removed in a future release! " + "See the breaking changes documentation for the next major version.", key); } } diff --git a/server/src/main/java/org/elasticsearch/common/time/DateFormatters.java b/server/src/main/java/org/elasticsearch/common/time/DateFormatters.java index 4ac5da17800e..e3b5a551cdbb 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateFormatters.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateFormatters.java @@ -1665,7 +1665,7 @@ public class DateFormatters { String msg = "Camel case format name {} is deprecated and will be removed in a future version. " + "Use snake case name {} instead."; deprecationLogger.getOrCompute() - .deprecate(DeprecationCategory.PARSING, "camelCaseDateFormat", msg, formatName.getCamelCaseName(), + .critical(DeprecationCategory.PARSING, "camelCaseDateFormat", msg, formatName.getCamelCaseName(), formatName.getSnakeCaseName()); } @@ -1747,7 +1747,7 @@ public class DateFormatters { return WEEK_DATE_TIME_NO_MILLIS; } else if (FormatNames.WEEK_YEAR.matches(input)) { deprecationLogger.getOrCompute() - .deprecate(DeprecationCategory.PARSING, + .critical(DeprecationCategory.PARSING, "week_year_format_name", "Format name \"week_year\" is deprecated and will be removed in a future version. " + "Use \"weekyear\" format instead"); return WEEK_YEAR; diff --git a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java index 6f399c1ca698..dc4b9ff8c348 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java @@ -193,7 +193,7 @@ public class DateUtils { public static ZoneId of(String zoneId) { String deprecatedId = DEPRECATED_SHORT_TIMEZONES.get(zoneId); if (deprecatedId != null) { - deprecationLogger.deprecate(DeprecationCategory.PARSING, "timezone", + deprecationLogger.critical(DeprecationCategory.PARSING, "timezone", "Use of short timezone id " + zoneId + " is deprecated. Use " + deprecatedId + " instead"); return ZoneId.of(deprecatedId); } diff --git a/server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java b/server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java index 32ba59c94297..88d6300c8ec7 100644 --- a/server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java +++ b/server/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java @@ -281,7 +281,7 @@ public class ByteSizeValue implements Writeable, Comparable, ToXC try { final double doubleValue = Double.parseDouble(s); DeprecationLoggerHolder.deprecationLogger - .deprecate(DeprecationCategory.PARSING, "fractional_byte_values", + .critical(DeprecationCategory.PARSING, "fractional_byte_values", "Fractional bytes values are deprecated. Use non-fractional bytes values instead: [{}] found for setting [{}]", initialInput, settingName); return new ByteSizeValue((long) (doubleValue * unit.toBytes(1))); diff --git a/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java b/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java index 1c91ef8382a0..98415d72298c 100644 --- a/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java +++ b/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java @@ -64,7 +64,7 @@ public class EsExecutors { final int value = Setting.parseInt(s, 1, name); final int availableProcessors = Runtime.getRuntime().availableProcessors(); if (value > availableProcessors) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SETTINGS, "processors", "setting [{}] to value [{}] which is more than available processors [{}] is deprecated", diff --git a/server/src/main/java/org/elasticsearch/common/xcontent/LoggingDeprecationHandler.java b/server/src/main/java/org/elasticsearch/common/xcontent/LoggingDeprecationHandler.java index 8ffd3576cd46..fb6a4593d676 100644 --- a/server/src/main/java/org/elasticsearch/common/xcontent/LoggingDeprecationHandler.java +++ b/server/src/main/java/org/elasticsearch/common/xcontent/LoggingDeprecationHandler.java @@ -41,21 +41,21 @@ public class LoggingDeprecationHandler implements DeprecationHandler { @Override public void usedDeprecatedName(String parserName, Supplier location, String usedName, String modernName) { String prefix = parserName == null ? "" : "[" + parserName + "][" + location.get() + "] "; - deprecationLogger.deprecate(DeprecationCategory.API, "deprecated_field_" + usedName, + deprecationLogger.critical(DeprecationCategory.API, "deprecated_field_" + usedName, "{}Deprecated field [{}] used, expected [{}] instead", prefix, usedName, modernName); } @Override public void usedDeprecatedField(String parserName, Supplier location, String usedName, String replacedWith) { String prefix = parserName == null ? "" : "[" + parserName + "][" + location.get() + "] "; - deprecationLogger.deprecate(DeprecationCategory.API, "deprecated_field_" + usedName, + deprecationLogger.critical(DeprecationCategory.API, "deprecated_field_" + usedName, "{}Deprecated field [{}] used, replaced by [{}]", prefix, usedName, replacedWith); } @Override public void usedDeprecatedField(String parserName, Supplier location, String usedName) { String prefix = parserName == null ? "" : "[" + parserName + "][" + location.get() + "] "; - deprecationLogger.deprecate(DeprecationCategory.API, "deprecated_field_" + usedName, + deprecationLogger.critical(DeprecationCategory.API, "deprecated_field_" + usedName, "{}Deprecated field [{}] used, this field is unused and will be removed entirely", prefix, usedName); } } diff --git a/server/src/main/java/org/elasticsearch/http/HttpInfo.java b/server/src/main/java/org/elasticsearch/http/HttpInfo.java index b2834e8c7997..26a28608b1a2 100644 --- a/server/src/main/java/org/elasticsearch/http/HttpInfo.java +++ b/server/src/main/java/org/elasticsearch/http/HttpInfo.java @@ -62,7 +62,7 @@ public class HttpInfo implements ReportingService.Info { String publishAddressString = publishAddress.toString(); String hostString = publishAddress.address().getHostString(); if (CNAME_IN_PUBLISH_HOST) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SETTINGS, "cname_in_publish_address", "es.http.cname_in_publish_address system property is deprecated and no longer affects http.publish_address " + diff --git a/server/src/main/java/org/elasticsearch/index/IndexSortConfig.java b/server/src/main/java/org/elasticsearch/index/IndexSortConfig.java index 7b3bb3633093..0991f7b7f50d 100644 --- a/server/src/main/java/org/elasticsearch/index/IndexSortConfig.java +++ b/server/src/main/java/org/elasticsearch/index/IndexSortConfig.java @@ -199,7 +199,7 @@ public final class IndexSortConfig { if (this.indexCreatedVersion.onOrAfter(Version.V_7_13_0)) { throw new IllegalArgumentException("Cannot use alias [" + sortSpec.field + "] as an index sort field"); } else { - DEPRECATION_LOGGER.deprecate( + DEPRECATION_LOGGER.critical( DeprecationCategory.MAPPINGS, "index-sort-aliases", "Index sort for index [" + indexName + "] defined on field [" + sortSpec.field + diff --git a/server/src/main/java/org/elasticsearch/index/analysis/Analysis.java b/server/src/main/java/org/elasticsearch/index/analysis/Analysis.java index 2e8f073fbb0c..492ba2823773 100644 --- a/server/src/main/java/org/elasticsearch/index/analysis/Analysis.java +++ b/server/src/main/java/org/elasticsearch/index/analysis/Analysis.java @@ -73,7 +73,7 @@ public class Analysis { public static void checkForDeprecatedVersion(String name, Settings settings) { String sVersion = settings.get("version"); if (sVersion != null) { - DEPRECATION_LOGGER.deprecate( + DEPRECATION_LOGGER.critical( DeprecationCategory.ANALYSIS, "analyzer.version", "Setting [version] on analysis component [" + name + "] has no effect and is deprecated" diff --git a/server/src/main/java/org/elasticsearch/index/analysis/PreConfiguredTokenFilter.java b/server/src/main/java/org/elasticsearch/index/analysis/PreConfiguredTokenFilter.java index 3fc05db5dc9c..6124a17e4130 100644 --- a/server/src/main/java/org/elasticsearch/index/analysis/PreConfiguredTokenFilter.java +++ b/server/src/main/java/org/elasticsearch/index/analysis/PreConfiguredTokenFilter.java @@ -120,7 +120,7 @@ public final class PreConfiguredTokenFilter extends PreConfiguredAnalysisCompone throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, name(), "Token filter [" + name() + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, name(), "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return this; } @@ -147,7 +147,7 @@ public final class PreConfiguredTokenFilter extends PreConfiguredAnalysisCompone throw new IllegalArgumentException("Token filter [" + name() + "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, name(), "Token filter [" + name() + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, name(), "Token filter [" + name() + "] will not be usable to parse synonyms after v7.0"); return this; } diff --git a/server/src/main/java/org/elasticsearch/index/analysis/ShingleTokenFilterFactory.java b/server/src/main/java/org/elasticsearch/index/analysis/ShingleTokenFilterFactory.java index 6a37b885dadc..ab2a3f0b7cc3 100644 --- a/server/src/main/java/org/elasticsearch/index/analysis/ShingleTokenFilterFactory.java +++ b/server/src/main/java/org/elasticsearch/index/analysis/ShingleTokenFilterFactory.java @@ -39,7 +39,7 @@ public class ShingleTokenFilterFactory extends AbstractTokenFilterFactory { + " must be less than or equal to: [" + maxAllowedShingleDiff + "] but was [" + shingleDiff + "]. This limit" + " can be set by changing the [" + IndexSettings.MAX_SHINGLE_DIFF_SETTING.getKey() + "] index level setting."); } else { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "excessive_shingle_diff", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "excessive_shingle_diff", "Deprecated big difference between maxShingleSize and minShingleSize" + " in Shingle TokenFilter, expected difference must be less than or equal to: [" + maxAllowedShingleDiff + "]"); } @@ -65,7 +65,7 @@ public class ShingleTokenFilterFactory extends AbstractTokenFilterFactory { "] cannot be used to parse synonyms"); } else { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter " + name() + DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter " + name() + "] will not be usable to parse synonym after v7.0"); } return this; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java index a9961c252e4e..0d686954f595 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java @@ -186,7 +186,7 @@ public class CompletionFieldMapper extends FieldMapper { private void checkCompletionContextsLimit() { if (this.contexts.getValue() != null && this.contexts.getValue().size() > COMPLETION_CONTEXTS_LIMIT) { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "excessive_completion_contexts", + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "excessive_completion_contexts", "You have defined more than [" + COMPLETION_CONTEXTS_LIMIT + "] completion contexts" + " in the mapping for field [" + name() + "]. " + "The maximum allowed number of completion contexts in a mapping will be limited to " + diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java index db9a6e2868e1..687eee3af0ee 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java @@ -299,7 +299,7 @@ public final class DateFieldMapper extends FieldMapper { try { return fieldType.parse(nullValue.getValue()); } catch (Exception e) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.MAPPINGS, "date_mapper_null_field", + DEPRECATION_LOGGER.critical(DeprecationCategory.MAPPINGS, "date_mapper_null_field", "Error parsing [" + nullValue.getValue() + "] as date in [null_value] on field [" + name() + "]);" + " [null_value] will be ignored"); return null; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java b/server/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java index a42a21c8d466..65c3762880d3 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java @@ -211,7 +211,7 @@ public class DynamicTemplate implements ToXContentObject { if (indexVersionCreated.onOrAfter(Version.V_6_0_0_alpha1)) { throw e; } else { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "invalid_mapping_type", + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "invalid_mapping_type", "match_mapping_type [" + matchMappingType + "] is invalid and will be ignored: " + e.getMessage()); // this template is on an unknown type so it will never match anything diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java index c3322c38d4cc..22c611fa155d 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java @@ -1195,7 +1195,7 @@ public abstract class FieldMapper extends Mapper implements Cloneable { } Parameter parameter = deprecatedParamsMap.get(propName); if (parameter != null) { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, propName, + deprecationLogger.critical(DeprecationCategory.MAPPINGS, propName, "Parameter [{}] on mapper [{}] is deprecated, use [{}]", propName, name, parameter.name); } else { @@ -1203,7 +1203,7 @@ public abstract class FieldMapper extends Mapper implements Cloneable { } if (parameter == null) { if (isDeprecatedParameter(propName, parserContext.indexVersionCreated())) { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, propName, + deprecationLogger.critical(DeprecationCategory.MAPPINGS, propName, "Parameter [{}] has no effect on type [{}] and will be removed in future", propName, type); iterator.remove(); continue; @@ -1211,7 +1211,7 @@ public abstract class FieldMapper extends Mapper implements Cloneable { if (parserContext.isFromDynamicTemplate()) { // The parameter is unknown, but this mapping is from a dynamic template. // Until 7.x it was possible to use unknown parameters there, so for bwc we need to ignore it - deprecationLogger.deprecate(DeprecationCategory.TEMPLATES, propName, + deprecationLogger.critical(DeprecationCategory.TEMPLATES, propName, "Parameter [{}] is used in a dynamic template mapping and has no effect on type [{}]. " + "Usage will result in an error in future major versions and should be removed.", propName, @@ -1225,14 +1225,14 @@ public abstract class FieldMapper extends Mapper implements Cloneable { ); } if (Objects.equals("boost", propName)) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.MAPPINGS, "boost", "Parameter [boost] on field [{}] is deprecated and will be removed in 8.0", name); } if (parameter.deprecated) { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, propName, + deprecationLogger.critical(DeprecationCategory.MAPPINGS, propName, "Parameter [{}] is deprecated and will be removed in a future version", propName); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java index 593ca72b9350..897975083bca 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java @@ -87,7 +87,7 @@ public class FieldNamesFieldMapper extends MetadataFieldMapper { @Override public FieldNamesFieldMapper build() { if (enabled.getValue().explicit()) { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "field_names_enabled_parameter", ENABLED_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "field_names_enabled_parameter", ENABLED_DEPRECATION_MESSAGE); } FieldNamesFieldType fieldNamesFieldType = new FieldNamesFieldType(enabled.getValue().value()); return new FieldNamesFieldMapper(enabled.getValue(), indexVersionCreated, fieldNamesFieldType); @@ -132,7 +132,7 @@ public class FieldNamesFieldMapper extends MetadataFieldMapper { if (isEnabled() == false) { throw new IllegalStateException("Cannot run [exists] queries if the [_field_names] field is disabled"); } - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "terms_query_on_field_names", + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "terms_query_on_field_names", "terms query on the _field_names field is deprecated and will be removed, use exists query instead"); return super.termQuery(value, context); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java index 3c930e030cac..88ae4eb44358 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java @@ -90,7 +90,7 @@ public class GeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper fieldData = fieldDataBuilder.build(cache, breakerService); return new IndexFieldData() { @Override diff --git a/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java index e59bca92f932..7a0b9f392dd6 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java @@ -123,7 +123,7 @@ public class IpFieldMapper extends FieldMapper { try { return InetAddresses.forString(nullValueAsString); } catch (Exception e) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.MAPPINGS, "ip_mapper_null_field", "Error parsing [" + nullValue.getValue() + DEPRECATION_LOGGER.critical(DeprecationCategory.MAPPINGS, "ip_mapper_null_field", "Error parsing [" + nullValue.getValue() + "] as IP in [null_value] on field [" + name() + "]); [null_value] will be ignored"); return null; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java b/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java index 0339226c302c..8df2c9d5caff 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java @@ -469,7 +469,7 @@ public class MapperService extends AbstractIndexComponent implements Closeable { if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_0_0)) { throw new IllegalArgumentException(DEFAULT_MAPPING_ERROR_MESSAGE); } else if (reason == MergeReason.MAPPING_UPDATE) { // only log in case of explicit mapping updates - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "default_mapping_not_allowed", DEFAULT_MAPPING_ERROR_MESSAGE); + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "default_mapping_not_allowed", DEFAULT_MAPPING_ERROR_MESSAGE); } assert defaultMapping.type().equals(DEFAULT_MAPPING); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java index df736344a65b..802333cd7026 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java @@ -153,7 +153,7 @@ public class ObjectMapper extends Mapper implements Cloneable { } return true; } else if (fieldName.equals("include_in_all")) { - deprecationLogger.deprecate(DeprecationCategory.API, "include_in_all", + deprecationLogger.critical(DeprecationCategory.API, "include_in_all", "[include_in_all] is deprecated, the _all field have been removed in this version"); return true; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java index b2635a149629..69bf64d123da 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java @@ -439,7 +439,7 @@ public class RootObjectMapper extends ObjectMapper { "attempted to validate it with the following match_mapping_type: %s, caused by [%s]"; String message = String.format(Locale.ROOT, format, template.getName(), Strings.toString(template), Arrays.toString(types), lastError.getMessage()); - DEPRECATION_LOGGER.deprecate(DeprecationCategory.TEMPLATES, "invalid_dynamic_template", message); + DEPRECATION_LOGGER.critical(DeprecationCategory.TEMPLATES, "invalid_dynamic_template", message); } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TypeFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/TypeFieldMapper.java index 67f1f373de53..6f5dc3d2ce3d 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TypeFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TypeFieldMapper.java @@ -38,7 +38,7 @@ public class TypeFieldMapper extends MetadataFieldMapper { "in queries and aggregations is deprecated, prefer to use a field instead."; public static void emitTypesDeprecationWarning() { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "query_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "query_with_types", TYPES_DEPRECATION_MESSAGE); } public static final String NAME = "_type"; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TypeFieldType.java b/server/src/main/java/org/elasticsearch/index/mapper/TypeFieldType.java index fbeba327c261..01306679e5c6 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TypeFieldType.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TypeFieldType.java @@ -55,13 +55,13 @@ public final class TypeFieldType extends ConstantFieldType { @Override public Query existsQuery(SearchExecutionContext context) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "typefieldtype", TYPES_V7_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "typefieldtype", TYPES_V7_DEPRECATION_MESSAGE); return new MatchAllDocsQuery(); } @Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName, Supplier searchLookup) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "typefieldtype", TYPES_V7_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "typefieldtype", TYPES_V7_DEPRECATION_MESSAGE); return new ConstantIndexFieldData.Builder(type, name(), CoreValuesSourceType.KEYWORD); } @@ -72,7 +72,7 @@ public final class TypeFieldType extends ConstantFieldType { @Override protected boolean matches(String pattern, boolean caseInsensitive, SearchExecutionContext context) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "typefieldtype", TYPES_V7_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "typefieldtype", TYPES_V7_DEPRECATION_MESSAGE); if (caseInsensitive) { return pattern.equalsIgnoreCase(type); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java b/server/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java index 53266b2b3b04..b307112ecc37 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java @@ -88,7 +88,7 @@ public class TypeParsers { MappingParserContext parserContext, String propName, Object propNode) { if (propName.equals("fields")) { if (parserContext.isWithinMultiField()) { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "multifield_within_multifield", + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "multifield_within_multifield", "At least one multi-field, [" + name + "], was " + "encountered that itself contains a multi-field. Defining multi-fields within a multi-field is deprecated and will " + "no longer be supported in 8.0. To resolve the issue, all instances of [fields] that occur within a [fields] block " + diff --git a/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java index 085ba1a5a03d..f94c6457af3c 100644 --- a/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java @@ -232,7 +232,7 @@ public class GeoShapeQueryBuilder extends AbstractGeometryQueryBuilder { try { IdsQueryBuilder builder = PARSER.apply(parser, null); if (builder.types().length > 0) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "ids_query_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "ids_query_with_types", TYPES_DEPRECATION_MESSAGE); } return builder; } catch (IllegalArgumentException e) { diff --git a/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java index d9d3e3727118..7a8756aa13bb 100644 --- a/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java @@ -958,7 +958,7 @@ public class MoreLikeThisQueryBuilder extends AbstractQueryBuilder { @Override protected Query doToQuery(SearchExecutionContext context) throws IOException { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "type_query", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "type_query", TYPES_DEPRECATION_MESSAGE); if (context.getType().equals(type)) { return Queries.newNonNestedFilter(context.indexVersionCreated()); } else { diff --git a/server/src/main/java/org/elasticsearch/index/query/functionscore/RandomScoreFunctionBuilder.java b/server/src/main/java/org/elasticsearch/index/query/functionscore/RandomScoreFunctionBuilder.java index c6f576187d65..e4bd863d2d30 100644 --- a/server/src/main/java/org/elasticsearch/index/query/functionscore/RandomScoreFunctionBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/functionscore/RandomScoreFunctionBuilder.java @@ -152,7 +152,7 @@ public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder destParser = new ObjectParser<>("dest"); destParser.declareString(IndexRequest::index, new ParseField("index")); destParser.declareString((request, type) -> { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "reindex_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "reindex_with_types", TYPES_DEPRECATION_MESSAGE); request.type(type); }, new ParseField("type")); destParser.declareString(IndexRequest::routing, new ParseField("routing")); diff --git a/server/src/main/java/org/elasticsearch/index/similarity/SimilarityProviders.java b/server/src/main/java/org/elasticsearch/index/similarity/SimilarityProviders.java index 0c33355c84ba..012c9862743a 100644 --- a/server/src/main/java/org/elasticsearch/index/similarity/SimilarityProviders.java +++ b/server/src/main/java/org/elasticsearch/index/similarity/SimilarityProviders.java @@ -132,7 +132,7 @@ final class SimilarityProviders { throw new IllegalArgumentException("Basic model [" + basicModel + "] isn't supported anymore, " + "please use another model."); } else { - deprecationLogger.deprecate(DeprecationCategory.QUERIES, basicModel + "_similarity_model_replaced", + deprecationLogger.critical(DeprecationCategory.QUERIES, basicModel + "_similarity_model_replaced", "Basic model [" + basicModel + "] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "]."); model = BASIC_MODELS.get(replacement); @@ -164,7 +164,7 @@ final class SimilarityProviders { throw new IllegalArgumentException("After effect [" + afterEffect + "] isn't supported anymore, please use another effect."); } else { - deprecationLogger.deprecate(DeprecationCategory.QUERIES, afterEffect + "_after_effect_replaced", + deprecationLogger.critical(DeprecationCategory.QUERIES, afterEffect + "_after_effect_replaced", "After effect [" + afterEffect + "] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "]."); effect = AFTER_EFFECTS.get(replacement); @@ -255,7 +255,7 @@ final class SimilarityProviders { if (version.onOrAfter(Version.V_7_0_0)) { throw new IllegalArgumentException("Unknown settings for similarity of type [" + type + "]: " + unknownSettings); } else { - deprecationLogger.deprecate(DeprecationCategory.QUERIES, "unknown_similarity_setting", + deprecationLogger.critical(DeprecationCategory.QUERIES, "unknown_similarity_setting", "Unknown settings for similarity of type [" + type + "]: " + unknownSettings); } } diff --git a/server/src/main/java/org/elasticsearch/index/similarity/SimilarityService.java b/server/src/main/java/org/elasticsearch/index/similarity/SimilarityService.java index 19dc11d1b0a0..df07b29b1bfb 100644 --- a/server/src/main/java/org/elasticsearch/index/similarity/SimilarityService.java +++ b/server/src/main/java/org/elasticsearch/index/similarity/SimilarityService.java @@ -55,7 +55,7 @@ public final class SimilarityService { } else { final ClassicSimilarity similarity = SimilarityProviders.createClassicSimilarity(Settings.EMPTY, version); return () -> { - deprecationLogger.deprecate(DeprecationCategory.QUERIES, "classic_similarity", + deprecationLogger.critical(DeprecationCategory.QUERIES, "classic_similarity", "The [classic] similarity is now deprecated in favour of BM25, which is generally " + "accepted as a better alternative. Use the [BM25] similarity or build a custom [scripted] similarity " + "instead."); @@ -79,7 +79,7 @@ public final class SimilarityService { throw new IllegalArgumentException("The [classic] similarity may not be used anymore. Please use the [BM25] " + "similarity or build a custom [scripted] similarity instead."); } else { - deprecationLogger.deprecate(DeprecationCategory.QUERIES, "classic_similarity", + deprecationLogger.critical(DeprecationCategory.QUERIES, "classic_similarity", "The [classic] similarity is now deprecated in favour of BM25, which is generally " + "accepted as a better alternative. Use the [BM25] similarity or build a custom [scripted] similarity " + "instead."); @@ -143,7 +143,7 @@ public final class SimilarityService { defaultSimilarity = (providers.get("default") != null) ? providers.get("default").get() : providers.get(SimilarityService.DEFAULT_SIMILARITY).get(); if (providers.get("base") != null) { - deprecationLogger.deprecate(DeprecationCategory.QUERIES, "base_similarity_ignored", + deprecationLogger.critical(DeprecationCategory.QUERIES, "base_similarity_ignored", "The [base] similarity is ignored since query normalization and coords have been removed"); } } @@ -264,7 +264,7 @@ public final class SimilarityService { if (indexCreatedVersion.onOrAfter(Version.V_7_0_0)) { throw new IllegalArgumentException(message); } else if (indexCreatedVersion.onOrAfter(Version.V_6_5_0)) { - deprecationLogger.deprecate(DeprecationCategory.QUERIES, "similarity_failure", message); + deprecationLogger.critical(DeprecationCategory.QUERIES, "similarity_failure", message); } } diff --git a/server/src/main/java/org/elasticsearch/indices/analysis/AnalysisModule.java b/server/src/main/java/org/elasticsearch/indices/analysis/AnalysisModule.java index 84cbf4f516fb..331e8f575421 100644 --- a/server/src/main/java/org/elasticsearch/indices/analysis/AnalysisModule.java +++ b/server/src/main/java/org/elasticsearch/indices/analysis/AnalysisModule.java @@ -114,7 +114,7 @@ public final class AnalysisModule { @Override public TokenFilterFactory get(IndexSettings indexSettings, Environment environment, String name, Settings settings) { if (indexSettings.getIndexVersionCreated().before(Version.V_7_0_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "standard_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "standard_deprecation", "The [standard] token filter name is deprecated and will be removed in a future version."); } else { throw new IllegalArgumentException("The [standard] token filter has been removed."); @@ -175,7 +175,7 @@ public final class AnalysisModule { // in certain circumstances to create a new index referencing the standard token filter // until version 7_5_2 if (version.before(Version.V_7_6_0)) { - deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "standard_deprecation", + deprecationLogger.critical(DeprecationCategory.ANALYSIS, "standard_deprecation", "The [standard] token filter is deprecated and will be removed in a future version."); } else { throw new IllegalArgumentException("The [standard] token filter has been removed."); diff --git a/server/src/main/java/org/elasticsearch/indices/flush/SyncedFlushService.java b/server/src/main/java/org/elasticsearch/indices/flush/SyncedFlushService.java index 1f3498bd508f..481e79271ff3 100644 --- a/server/src/main/java/org/elasticsearch/indices/flush/SyncedFlushService.java +++ b/server/src/main/java/org/elasticsearch/indices/flush/SyncedFlushService.java @@ -150,7 +150,7 @@ public class SyncedFlushService implements IndexEventListener { final ActionListener listener) { final ClusterState state = clusterService.state(); if (state.nodes().getMinNodeVersion().onOrAfter(Version.V_7_6_0)) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.API, "synced_flush", SYNCED_FLUSH_DEPRECATION_MESSAGE); + DEPRECATION_LOGGER.critical(DeprecationCategory.API, "synced_flush", SYNCED_FLUSH_DEPRECATION_MESSAGE); } final Index[] concreteIndices = indexNameExpressionResolver.concreteIndices(state, indicesOptions, aliasesOrIndices); final Map> results = ConcurrentCollections.newConcurrentMap(); diff --git a/server/src/main/java/org/elasticsearch/ingest/ConditionalProcessor.java b/server/src/main/java/org/elasticsearch/ingest/ConditionalProcessor.java index d7ec1c3d46fc..8f441b5f6f19 100644 --- a/server/src/main/java/org/elasticsearch/ingest/ConditionalProcessor.java +++ b/server/src/main/java/org/elasticsearch/ingest/ConditionalProcessor.java @@ -38,7 +38,7 @@ public class ConditionalProcessor extends AbstractProcessor implements WrappingP private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); private static final Map> FUNCTIONS = org.elasticsearch.core.Map.of( "_type", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "conditional-processor__type", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "conditional-processor__type", "[types removal] Looking up doc types [_type] in scripts is deprecated."); return value; }); diff --git a/server/src/main/java/org/elasticsearch/node/Node.java b/server/src/main/java/org/elasticsearch/node/Node.java index 25440160b5cd..d06bcdd6bba0 100644 --- a/server/src/main/java/org/elasticsearch/node/Node.java +++ b/server/src/main/java/org/elasticsearch/node/Node.java @@ -324,7 +324,7 @@ public class Node implements Closeable { logger.info("JVM home [{}], using bundled JDK [{}]", System.getProperty("java.home"), jvmInfo.getUsingBundledJdk()); } else { logger.info("JVM home [{}]", System.getProperty("java.home")); - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.OTHER, "no-jdk", "no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release"); @@ -338,7 +338,7 @@ public class Node implements Closeable { if (Environment.PATH_SHARED_DATA_SETTING.exists(tmpSettings)) { // NOTE: this must be done with an explicit check here because the deprecation property on a path setting will // cause ES to fail to start since logging is not yet initialized on first read of the setting - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SETTINGS, "shared-data-path", "setting [path.shared_data] is deprecated and will be removed in a future release" @@ -347,13 +347,13 @@ public class Node implements Closeable { if (initialEnvironment.dataFiles().length > 1) { // NOTE: we use initialEnvironment here, but assertEquivalent below ensures the data paths do not change - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "multiple-data-paths", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "multiple-data-paths", "Configuring multiple [path.data] paths is deprecated. Use RAID or other system level features for utilizing " + "multiple disks. This feature will be removed in 8.0."); } if (Environment.dataPathUsesList(tmpSettings)) { // already checked for multiple values above, so if this is a list it is a single valued list - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "multiple-data-paths-list", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "multiple-data-paths-list", "Configuring [path.data] with a list is deprecated. Instead specify as a string value."); } @@ -402,7 +402,7 @@ public class Node implements Closeable { if (maybeLegacyRoleSettings.isEmpty() == false) { final String legacyRoleSettingNames = maybeLegacyRoleSettings.stream().map(Setting::getKey).collect(Collectors.joining(", ")); - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SETTINGS, "legacy role settings", "legacy role settings [{}] are deprecated, use [node.roles={}]", diff --git a/server/src/main/java/org/elasticsearch/rest/DeprecationRestHandler.java b/server/src/main/java/org/elasticsearch/rest/DeprecationRestHandler.java index 5cffbfddc93a..5a441de2a145 100644 --- a/server/src/main/java/org/elasticsearch/rest/DeprecationRestHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/DeprecationRestHandler.java @@ -53,7 +53,7 @@ public class DeprecationRestHandler implements RestHandler { */ @Override public void handleRequest(RestRequest request, RestChannel channel, NodeClient client) throws Exception { - deprecationLogger.deprecate(DeprecationCategory.API, deprecationKey, deprecationMessage); + deprecationLogger.critical(DeprecationCategory.API, deprecationKey, deprecationMessage); handler.handleRequest(request, channel, client); } diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCloseIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCloseIndexAction.java index 7abf302c92e0..bcc44020ba7f 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCloseIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCloseIndexAction.java @@ -54,7 +54,7 @@ public class RestCloseIndexAction extends BaseRestHandler { closeIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, closeIndexRequest.indicesOptions())); String waitForActiveShards = request.param("wait_for_active_shards"); if (waitForActiveShards == null) { - deprecationLogger.deprecate(DeprecationCategory.API, "close-index-wait_for_active_shards-default", + deprecationLogger.critical(DeprecationCategory.API, "close-index-wait_for_active_shards-default", WAIT_FOR_ACTIVE_SHARDS_DEFAULT_DEPRECATION_MESSAGE); } else if ("index-setting".equalsIgnoreCase(waitForActiveShards)) { closeIndexRequest.waitForActiveShards(ActiveShardCount.DEFAULT); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java index 3d8def55cb4a..2e9857405ac2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java @@ -50,7 +50,7 @@ public class RestCreateIndexAction extends BaseRestHandler { DEFAULT_INCLUDE_TYPE_NAME_POLICY); if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "create_index_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "create_index_with_types", TYPES_DEPRECATION_MESSAGE); } CreateIndexRequest createIndexRequest = new CreateIndexRequest(request.param("index")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestForceMergeAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestForceMergeAction.java index c4c8fc783ef2..9a1f9cb37bb3 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestForceMergeAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestForceMergeAction.java @@ -49,7 +49,7 @@ public class RestForceMergeAction extends BaseRestHandler { mergeRequest.onlyExpungeDeletes(request.paramAsBoolean("only_expunge_deletes", mergeRequest.onlyExpungeDeletes())); mergeRequest.flush(request.paramAsBoolean("flush", mergeRequest.flush())); if (mergeRequest.onlyExpungeDeletes() && mergeRequest.maxNumSegments() != ForceMergeRequest.Defaults.MAX_NUM_SEGMENTS) { - deprecationLogger.deprecate(DeprecationCategory.API, "force_merge_expunge_deletes_and_max_num_segments_deprecation", + deprecationLogger.critical(DeprecationCategory.API, "force_merge_expunge_deletes_and_max_num_segments_deprecation", "setting only_expunge_deletes and max_num_segments at the same time is deprecated and will be rejected in a future version"); } return channel -> client.admin().indices().forceMerge(mergeRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java index 6481407e6969..f64ff256ebdd 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java @@ -70,7 +70,7 @@ public class RestGetFieldMappingAction extends BaseRestHandler { " is set to true."); } if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "get_field_mapping_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "get_field_mapping_with_types", TYPES_DEPRECATION_MESSAGE); } GetFieldMappingsRequest getMappingsRequest = new GetFieldMappingsRequest(); @@ -78,7 +78,7 @@ public class RestGetFieldMappingAction extends BaseRestHandler { getMappingsRequest.indicesOptions(IndicesOptions.fromRequest(request, getMappingsRequest.indicesOptions())); if (request.hasParam("local")) { - deprecationLogger.deprecate(DeprecationCategory.API, "get_field_mapping_local", + deprecationLogger.critical(DeprecationCategory.API, "get_field_mapping_local", "Use [local] in get field mapping requests is deprecated. " + "The parameter will be removed in the next major version"); } diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java index c16778a90f98..86b10bcf9d02 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java @@ -63,7 +63,7 @@ public class RestGetIndexTemplateAction extends BaseRestHandler { final GetIndexTemplatesRequest getIndexTemplatesRequest = new GetIndexTemplatesRequest(names); if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "get_index_template_include_type_name", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "get_index_template_include_type_name", TYPES_DEPRECATION_MESSAGE); } getIndexTemplatesRequest.local(request.paramAsBoolean("local", getIndexTemplatesRequest.local())); getIndexTemplatesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexTemplatesRequest.masterNodeTimeout())); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java index a4fe5b2db503..2594d62a62a9 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java @@ -62,7 +62,7 @@ public class RestGetIndicesAction extends BaseRestHandler { String[] indices = Strings.splitStringByCommaToArray(request.param("index")); // starting with 7.0 we don't include types by default in the response to GET requests if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER) && request.method().equals(GET)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "get_indices_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "get_indices_with_types", TYPES_DEPRECATION_MESSAGE); } final GetIndexRequest getIndexRequest = new GetIndexRequest(); getIndexRequest.indices(indices); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java index e1dd9edd4dd8..fdad5824e2d8 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java @@ -90,14 +90,14 @@ public class RestGetMappingAction extends BaseRestHandler { boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY); if (request.method().equals(HEAD)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "get_mapping_types_removal", + deprecationLogger.critical(DeprecationCategory.TYPES, "get_mapping_types_removal", "Type exists requests are deprecated, as types have been deprecated."); } else if (includeTypeName == false && types.length > 0) { throw new IllegalArgumentException("Types cannot be provided in get mapping requests, unless" + " include_type_name is set to true."); } if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "get_mapping_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "get_mapping_with_types", TYPES_DEPRECATION_MESSAGE); } final GetMappingsRequest getMappingsRequest = new GetMappingsRequest(); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java index 90a18c31c5ab..e8feef2e0cd6 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java @@ -60,10 +60,10 @@ public class RestPutIndexTemplateAction extends BaseRestHandler { PutIndexTemplateRequest putRequest = new PutIndexTemplateRequest(request.param("name")); if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "put_index_template_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "put_index_template_with_types", TYPES_DEPRECATION_MESSAGE); } if (request.hasParam("template")) { - deprecationLogger.deprecate(DeprecationCategory.API, "put_index_template_deprecated_parameter", + deprecationLogger.critical(DeprecationCategory.API, "put_index_template_deprecated_parameter", "Deprecated parameter [template] used, replaced by [index_patterns]"); putRequest.patterns(Collections.singletonList(request.param("template"))); } else { diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java index 34f52f24c42c..95c2e1fe234e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java @@ -67,7 +67,7 @@ public class RestPutMappingAction extends BaseRestHandler { final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY); if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "put_mapping_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "put_mapping_with_types", TYPES_DEPRECATION_MESSAGE); } PutMappingRequest putMappingRequest = putMappingRequest(Strings.splitStringByCommaToArray(request.param("index"))); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java index 588d2b265244..532397938dd5 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java @@ -61,7 +61,7 @@ public abstract class RestResizeHandler extends BaseRestHandler { throw new IllegalArgumentException("parameter [copy_settings] can not be explicitly set to [false]"); } } - deprecationLogger.deprecate(DeprecationCategory.API, "resize_deprecated_parameter", + deprecationLogger.critical(DeprecationCategory.API, "resize_deprecated_parameter", "parameter [copy_settings] is deprecated and will be removed in 8.0.0"); } resizeRequest.setCopySettings(copySettings); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRolloverIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRolloverIndexAction.java index bf49c38b71d8..d0aa38096d0b 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRolloverIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRolloverIndexAction.java @@ -46,7 +46,7 @@ public class RestRolloverIndexAction extends BaseRestHandler { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY); if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "index_rollover_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "index_rollover_with_types", TYPES_DEPRECATION_MESSAGE); } RolloverRequest rolloverIndexRequest = new RolloverRequest(request.param("index"), request.param("new_index")); request.applyContentParser(parser -> rolloverIndexRequest.fromXContent(includeTypeName, parser)); diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java index 853c021cf524..ddc836ba6653 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java @@ -62,7 +62,7 @@ public class RestValidateQueryAction extends BaseRestHandler { validateQueryRequest.explain(request.paramAsBoolean("explain", false)); if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "validate_query_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "validate_query_with_types", TYPES_DEPRECATION_MESSAGE); validateQueryRequest.types(Strings.splitStringByCommaToArray(request.param("type"))); } diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java index 1110d2d9f842..9e1c4446e0cb 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java @@ -91,7 +91,7 @@ public class RestIndicesAction extends AbstractCatAction { final String[] indices = Strings.splitStringByCommaToArray(request.param("index")); final IndicesOptions indicesOptions = IndicesOptions.fromRequest(request, IndicesOptions.strictExpand()); if (request.hasParam("local")) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.API, "local", LOCAL_DEPRECATED_MESSAGE); + DEPRECATION_LOGGER.critical(DeprecationCategory.API, "local", LOCAL_DEPRECATED_MESSAGE); } final boolean local = request.paramAsBoolean("local", false); final TimeValue masterNodeTimeout = request.paramAsTime("master_timeout", DEFAULT_MASTER_NODE_TIMEOUT); diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java index 1f182ff81c1e..1564ff51cc45 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java @@ -84,7 +84,7 @@ public class RestNodesAction extends AbstractCatAction { final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.clear().nodes(true); if (request.hasParam("local")) { - deprecationLogger.deprecate(DeprecationCategory.API, "cat_nodes_local_parameter", LOCAL_DEPRECATED_MESSAGE); + deprecationLogger.critical(DeprecationCategory.API, "cat_nodes_local_parameter", LOCAL_DEPRECATED_MESSAGE); } clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java index 42d26afacee5..696db8a4e480 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java @@ -84,7 +84,7 @@ public class RestShardsAction extends AbstractCatAction { final String[] indices = Strings.splitStringByCommaToArray(request.param("index")); final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); if (request.hasParam("local")) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.API, "local", LOCAL_DEPRECATED_MESSAGE); + DEPRECATION_LOGGER.critical(DeprecationCategory.API, "local", LOCAL_DEPRECATED_MESSAGE); } clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java index c6beccdf1f7f..a10c5e17b898 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java @@ -77,7 +77,7 @@ public class RestBulkAction extends BaseRestHandler { if (defaultType == null) { defaultType = MapperService.SINGLE_MAPPING_NAME; } else { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "bulk_with_types", RestBulkAction.TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "bulk_with_types", RestBulkAction.TYPES_DEPRECATION_MESSAGE); } String defaultRouting = request.param("routing"); FetchSourceContext defaultFetchSourceContext = FetchSourceContext.parseFromRestRequest(request); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java index c6381e452304..6acdeb051a9e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java @@ -48,7 +48,7 @@ public class RestDeleteAction extends BaseRestHandler { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { DeleteRequest deleteRequest; if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "delete_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "delete_with_types", TYPES_DEPRECATION_MESSAGE); deleteRequest = new DeleteRequest(request.param("index"), request.param("type"), request.param("id")); } else { deleteRequest = new DeleteRequest(request.param("index"), request.param("id")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java index 9097df38efb7..9d9c63210747 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java @@ -56,7 +56,7 @@ public class RestGetAction extends BaseRestHandler { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { GetRequest getRequest; if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "get_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "get_with_types", TYPES_DEPRECATION_MESSAGE); getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id")); } else { getRequest = new GetRequest(request.param("index"), request.param("id")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java index 30ea1c69bfe6..76c81ddbf3b4 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java @@ -63,7 +63,7 @@ public class RestGetSourceAction extends BaseRestHandler { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final GetRequest getRequest; if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "get_source_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "get_source_with_types", TYPES_DEPRECATION_MESSAGE); getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id")); } else { getRequest = new GetRequest(request.param("index"), request.param("id")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java index fa89a7d5bfa6..ad117df10cef 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java @@ -119,7 +119,7 @@ public class RestIndexAction extends BaseRestHandler { IndexRequest indexRequest; final String type = request.param("type"); if (type != null && type.equals(MapperService.SINGLE_MAPPING_NAME) == false) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "index_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "index_with_types", TYPES_DEPRECATION_MESSAGE); indexRequest = new IndexRequest(request.param("index"), type, request.param("id")); } else { indexRequest = new IndexRequest(request.param("index")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java index 65783002559d..49f87ff4baed 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java @@ -59,7 +59,7 @@ public class RestMultiGetAction extends BaseRestHandler { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { if (request.param("type") != null) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "mget_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "mget_with_types", TYPES_DEPRECATION_MESSAGE); } MultiGetRequest multiGetRequest = new MultiGetRequest(); @@ -84,7 +84,7 @@ public class RestMultiGetAction extends BaseRestHandler { for (MultiGetRequest.Item item : multiGetRequest.getItems()) { if (item.type() != null) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "multi_get_types_removal", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "multi_get_types_removal", TYPES_DEPRECATION_MESSAGE); break; } } diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java index 6c20ffa78372..5480222401f6 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java @@ -56,7 +56,7 @@ public class RestMultiTermVectorsAction extends BaseRestHandler { .index(request.param("index")); if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "mtermvectors_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "mtermvectors_with_types", TYPES_DEPRECATION_MESSAGE); template.type(request.param("type")); } else { template.type(MapperService.SINGLE_MAPPING_NAME); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java index 38dc38eba6e5..bc7c90d6d219 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java @@ -63,7 +63,7 @@ public class RestTermVectorsAction extends BaseRestHandler { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { TermVectorsRequest termVectorsRequest; if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "termvectors_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "termvectors_with_types", TYPES_DEPRECATION_MESSAGE); termVectorsRequest = new TermVectorsRequest(request.param("index"), request.param("type"), request.param("id")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java index b25a2ffbb541..a774e15ada78 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java @@ -53,7 +53,7 @@ public class RestUpdateAction extends BaseRestHandler { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { UpdateRequest updateRequest; if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "update_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "update_with_types", TYPES_DEPRECATION_MESSAGE); updateRequest = new UpdateRequest(request.param("index"), request.param("type"), request.param("id")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java index 8671ffd18f9d..be4430f86015 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java @@ -80,7 +80,7 @@ public class RestCountAction extends BaseRestHandler { } if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "count_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "count_with_types", TYPES_DEPRECATION_MESSAGE); countRequest.types(Strings.splitStringByCommaToArray(request.param("type"))); } diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestExplainAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestExplainAction.java index 7c7e94824c3b..82e6fc32678f 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestExplainAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestExplainAction.java @@ -55,7 +55,7 @@ public class RestExplainAction extends BaseRestHandler { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { ExplainRequest explainRequest; if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "explain_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "explain_with_types", TYPES_DEPRECATION_MESSAGE); explainRequest = new ExplainRequest(request.param("index"), request.param("type"), request.param("id")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java index 3bdb28840c1d..0bbd0fa1ea52 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java @@ -86,7 +86,7 @@ public class RestMultiSearchAction extends BaseRestHandler { // Emit a single deprecation message if any search request contains types. for (SearchRequest searchRequest : multiSearchRequest.requests()) { if (searchRequest.types().length > 0) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "msearch_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "msearch_with_types", TYPES_DEPRECATION_MESSAGE); break; } } diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java index e53b8c033ea7..743c42fa0c4d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java @@ -173,7 +173,7 @@ public class RestSearchAction extends BaseRestHandler { } if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "search_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "search_with_types", TYPES_DEPRECATION_MESSAGE); searchRequest.types(Strings.splitStringByCommaToArray(request.param("type"))); } searchRequest.routing(request.param("routing")); @@ -209,7 +209,7 @@ public class RestSearchAction extends BaseRestHandler { if (size != -1) { setSize.accept(size); } else { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.API, "search-api-size-1", "Using search size of -1 is deprecated and will be removed in future versions. Instead, don't use the `size` parameter " diff --git a/server/src/main/java/org/elasticsearch/script/AbstractSortScript.java b/server/src/main/java/org/elasticsearch/script/AbstractSortScript.java index d1da9d369f3c..acf3c58d8a63 100644 --- a/server/src/main/java/org/elasticsearch/script/AbstractSortScript.java +++ b/server/src/main/java/org/elasticsearch/script/AbstractSortScript.java @@ -24,13 +24,13 @@ abstract class AbstractSortScript extends DocBasedScript implements ScorerAware private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); private static final Map> PARAMS_FUNCTIONS = org.elasticsearch.core.Map.of( "doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "sort-script_doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "sort-script_doc", "Accessing variable [doc] via [params.doc] from within an sort-script " + "is deprecated in favor of directly accessing [doc]."); return value; }, "_doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "sort-script__doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "sort-script__doc", "Accessing variable [doc] via [params._doc] from within an sort-script " + "is deprecated in favor of directly accessing [doc]."); return value; diff --git a/server/src/main/java/org/elasticsearch/script/AggregationScript.java b/server/src/main/java/org/elasticsearch/script/AggregationScript.java index 1dc31242a8cd..a9fb570c0adc 100644 --- a/server/src/main/java/org/elasticsearch/script/AggregationScript.java +++ b/server/src/main/java/org/elasticsearch/script/AggregationScript.java @@ -30,13 +30,13 @@ public abstract class AggregationScript extends DocBasedScript implements Scorer private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); private static final Map> PARAMS_FUNCTIONS = org.elasticsearch.core.Map.of( "doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "aggregation-script_doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "aggregation-script_doc", "Accessing variable [doc] via [params.doc] from within an aggregation-script " + "is deprecated in favor of directly accessing [doc]."); return value; }, "_doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "aggregation-script__doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "aggregation-script__doc", "Accessing variable [doc] via [params._doc] from within an aggregation-script " + "is deprecated in favor of directly accessing [doc]."); return value; diff --git a/server/src/main/java/org/elasticsearch/script/FieldScript.java b/server/src/main/java/org/elasticsearch/script/FieldScript.java index 5a7f1552f373..0ba9146cd7f3 100644 --- a/server/src/main/java/org/elasticsearch/script/FieldScript.java +++ b/server/src/main/java/org/elasticsearch/script/FieldScript.java @@ -29,13 +29,13 @@ public abstract class FieldScript extends DocBasedScript { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); private static final Map> PARAMS_FUNCTIONS = org.elasticsearch.core.Map.of( "doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "field-script_doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "field-script_doc", "Accessing variable [doc] via [params.doc] from within an field-script " + "is deprecated in favor of directly accessing [doc]."); return value; }, "_doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "field-script__doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "field-script__doc", "Accessing variable [doc] via [params._doc] from within an field-script " + "is deprecated in favor of directly accessing [doc]."); return value; diff --git a/server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java b/server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java index 4067e77e0b92..62902283b951 100644 --- a/server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java +++ b/server/src/main/java/org/elasticsearch/script/JodaCompatibleZonedDateTime.java @@ -58,7 +58,7 @@ public class JodaCompatibleZonedDateTime @SuppressLoggerChecks(reason = "safely delegates to logger") @Override public Void run() { - deprecationLogger.deprecate(DeprecationCategory.PARSING, key, message, params); + deprecationLogger.critical(DeprecationCategory.PARSING, key, message, params); return null; } }); diff --git a/server/src/main/java/org/elasticsearch/script/ScoreScript.java b/server/src/main/java/org/elasticsearch/script/ScoreScript.java index 8261bcdbd6ae..ed63eb8085ed 100644 --- a/server/src/main/java/org/elasticsearch/script/ScoreScript.java +++ b/server/src/main/java/org/elasticsearch/script/ScoreScript.java @@ -53,13 +53,13 @@ public abstract class ScoreScript extends DocBasedScript { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); private static final Map> PARAMS_FUNCTIONS = org.elasticsearch.core.Map.of( "doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "score-script_doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "score-script_doc", "Accessing variable [doc] via [params.doc] from within an score-script " + "is deprecated in favor of directly accessing [doc]."); return value; }, "_doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "score-script__doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "score-script__doc", "Accessing variable [doc] via [params._doc] from within an score-script " + "is deprecated in favor of directly accessing [doc]."); return value; diff --git a/server/src/main/java/org/elasticsearch/script/Script.java b/server/src/main/java/org/elasticsearch/script/Script.java index a77a4a89fc9d..ee756628acaf 100644 --- a/server/src/main/java/org/elasticsearch/script/Script.java +++ b/server/src/main/java/org/elasticsearch/script/Script.java @@ -452,7 +452,7 @@ public final class Script implements ToXContentObject, Writeable { throw new ElasticsearchParseException("Value must be of type String: [" + parameterName + "]"); } } else { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "script_unsupported_fields", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "script_unsupported_fields", "script section does not support [" + parameterName + "]"); } } diff --git a/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java b/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java index ae95324693aa..7d3c1149f54a 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptMetadata.java @@ -208,10 +208,10 @@ public final class ScriptMetadata implements Metadata.Custom, Writeable, ToXCont if (source.getSource().isEmpty()) { if (source.getLang().equals(Script.DEFAULT_TEMPLATE_LANG)) { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "empty_templates", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "empty_templates", "empty templates should no longer be used"); } else { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "empty_scripts", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "empty_scripts", "empty scripts should no longer be used"); } } diff --git a/server/src/main/java/org/elasticsearch/script/ScriptedMetricAggContexts.java b/server/src/main/java/org/elasticsearch/script/ScriptedMetricAggContexts.java index e31852cf8d9f..90fb0886b1b0 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptedMetricAggContexts.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptedMetricAggContexts.java @@ -57,18 +57,18 @@ public class ScriptedMetricAggContexts { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); private static final Map> PARAMS_FUNCTIONS = org.elasticsearch.core.Map.of( "doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "map-script_doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "map-script_doc", "Accessing variable [doc] via [params.doc] from within an scripted metric agg map script " + "is deprecated in favor of directly accessing [doc]."); return value; }, "_doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "map-script__doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "map-script__doc", "Accessing variable [doc] via [params._doc] from within an scripted metric agg map script " + "is deprecated in favor of directly accessing [doc]."); return value; }, "_agg", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "map-script__agg", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "map-script__agg", "Accessing variable [_agg] via [params._agg] from within a scripted metric agg map script " + "is deprecated in favor of using [state]."); return value; diff --git a/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java b/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java index 80b78eebbdf2..99e33a824be2 100644 --- a/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java +++ b/server/src/main/java/org/elasticsearch/script/StoredScriptSource.java @@ -134,10 +134,10 @@ public class StoredScriptSource extends AbstractDiffable imp if (source == null) { if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "empty_templates", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "empty_templates", "empty templates should no longer be used"); } else { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "empty_scripts", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "empty_scripts", "empty scripts should no longer be used"); } } else { @@ -146,10 +146,10 @@ public class StoredScriptSource extends AbstractDiffable imp } else if (source.isEmpty()) { if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "empty_templates", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "empty_templates", "empty templates should no longer be used"); } else { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "empty_scripts", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "empty_scripts", "empty scripts should no longer be used"); } } else { @@ -250,7 +250,7 @@ public class StoredScriptSource extends AbstractDiffable imp token = parser.nextToken(); if (token == Token.END_OBJECT) { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "empty_templates", "empty templates should no longer be used"); + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "empty_templates", "empty templates should no longer be used"); return new StoredScriptSource(Script.DEFAULT_TEMPLATE_LANG, "", Collections.emptyMap()); } diff --git a/server/src/main/java/org/elasticsearch/script/TermsSetQueryScript.java b/server/src/main/java/org/elasticsearch/script/TermsSetQueryScript.java index c98aad261beb..15078c677ecc 100644 --- a/server/src/main/java/org/elasticsearch/script/TermsSetQueryScript.java +++ b/server/src/main/java/org/elasticsearch/script/TermsSetQueryScript.java @@ -29,13 +29,13 @@ public abstract class TermsSetQueryScript { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); private static final Map> PARAMS_FUNCTIONS = org.elasticsearch.core.Map.of( "doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "terms-set-query-script_doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "terms-set-query-script_doc", "Accessing variable [doc] via [params.doc] from within an terms-set-query-script " + "is deprecated in favor of directly accessing [doc]."); return value; }, "_doc", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "terms-set-query-script__doc", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "terms-set-query-script__doc", "Accessing variable [doc] via [params._doc] from within an terms-set-query-script " + "is deprecated in favor of directly accessing [doc]."); return value; diff --git a/server/src/main/java/org/elasticsearch/script/UpdateScript.java b/server/src/main/java/org/elasticsearch/script/UpdateScript.java index 935175e49905..e2b39e83bedf 100644 --- a/server/src/main/java/org/elasticsearch/script/UpdateScript.java +++ b/server/src/main/java/org/elasticsearch/script/UpdateScript.java @@ -24,7 +24,7 @@ public abstract class UpdateScript { DeprecationLogger.getLogger(DynamicMap.class); private static final Map> PARAMS_FUNCTIONS = org.elasticsearch.core.Map.of( "_type", value -> { - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "update-script", + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "update-script", "[types removal] Looking up doc types [_type] in scripts is deprecated."); return value; }); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java b/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java index 1730712cbdd4..9027312158a8 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java @@ -642,7 +642,7 @@ public abstract class InternalOrder extends BucketOrder { } // _term and _time order deprecated in 6.0; replaced by _key if ("_term".equals(orderKey) || "_time".equals(orderKey)) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.AGGREGATIONS, "aggregation_order_key", "Deprecated aggregation order key [{}] used, replaced by [_key]", diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java index 4ffd31ea6ffd..e7fa4f92c5e0 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java @@ -51,7 +51,7 @@ public final class AutoDateHistogramAggregatorFactory extends ValuesSourceAggreg CardinalityUpperBound cardinality, Map metadata) -> { - DEPRECATION_LOGGER.deprecate( + DEPRECATION_LOGGER.critical( DeprecationCategory.AGGREGATIONS, "auto-date-histogram-boolean", "Running AutoIntervalDateHistogram aggregations on [boolean] fields is deprecated" diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java index d8e46076c174..c51ae4fb9c84 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java @@ -56,7 +56,7 @@ public final class DateHistogramAggregatorFactory extends ValuesSourceAggregator parent, cardinality, metadata) -> { - DEPRECATION_LOGGER.deprecate( + DEPRECATION_LOGGER.critical( DeprecationCategory.AGGREGATIONS, "date-histogram-boolean", "Running DateHistogram aggregations on [boolean] fields is deprecated" diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java index 62cf81f7a162..c5a02d08e243 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java @@ -137,7 +137,7 @@ public class DateIntervalWrapper implements ToXContentFragment, Writeable { /** Get the current interval in milliseconds that is set on this builder. */ @Deprecated public long interval() { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.AGGREGATIONS, "date-interval-getter", DEPRECATION_TEXT); + DEPRECATION_LOGGER.critical(DeprecationCategory.AGGREGATIONS, "date-interval-getter", DEPRECATION_TEXT); if (intervalType.equals(IntervalTypeEnum.LEGACY_INTERVAL)) { return TimeValue.parseTimeValue(dateHistogramInterval.toString(), "interval").getMillis(); } @@ -158,14 +158,14 @@ public class DateIntervalWrapper implements ToXContentFragment, Writeable { throw new IllegalArgumentException("[interval] must be 1 or greater for aggregation [date_histogram]"); } setIntervalType(IntervalTypeEnum.LEGACY_INTERVAL); - DEPRECATION_LOGGER.deprecate(DeprecationCategory.AGGREGATIONS, "date-interval-setter", DEPRECATION_TEXT); + DEPRECATION_LOGGER.critical(DeprecationCategory.AGGREGATIONS, "date-interval-setter", DEPRECATION_TEXT); this.dateHistogramInterval = new DateHistogramInterval(interval + "ms"); } /** Get the current date interval that is set on this builder. */ @Deprecated public DateHistogramInterval dateHistogramInterval() { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.AGGREGATIONS, "date-histogram-interval-getter", DEPRECATION_TEXT); + DEPRECATION_LOGGER.critical(DeprecationCategory.AGGREGATIONS, "date-histogram-interval-getter", DEPRECATION_TEXT); if (intervalType.equals(IntervalTypeEnum.LEGACY_DATE_HISTO)) { return dateHistogramInterval; } @@ -186,7 +186,7 @@ public class DateIntervalWrapper implements ToXContentFragment, Writeable { throw new IllegalArgumentException("[dateHistogramInterval] must not be null: [date_histogram]"); } setIntervalType(IntervalTypeEnum.LEGACY_DATE_HISTO); - DEPRECATION_LOGGER.deprecate(DeprecationCategory.AGGREGATIONS, "date-histogram-interval-setter", DEPRECATION_TEXT); + DEPRECATION_LOGGER.critical(DeprecationCategory.AGGREGATIONS, "date-histogram-interval-setter", DEPRECATION_TEXT); this.dateHistogramInterval = dateHistogramInterval; } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java index 2c3360e7cb96..15c0529c93b7 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java @@ -71,7 +71,7 @@ public class DateRangeAggregationBuilder extends AbstractRangeBuilder metadata) -> { - DEPRECATION_LOGGER.deprecate( + DEPRECATION_LOGGER.critical( DeprecationCategory.AGGREGATIONS, "Range-boolean", "Running Range or DateRange aggregations on [boolean] fields is deprecated" diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java index d2a6cba5ac00..b036de2eae4a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java @@ -372,7 +372,7 @@ public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFac if ("global_ordinals".equals(value)) { return GLOBAL_ORDINALS; } else if ("global_ordinals_hash".equals(value)) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.AGGREGATIONS, "global_ordinals_hash", "global_ordinals_hash is deprecated. Please use [global_ordinals] instead." diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java index 9e621240813e..89d43f5e8f67 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/metrics/PercentilesAggregationBuilder.java @@ -116,7 +116,7 @@ public class PercentilesAggregationBuilder extends AbstractPercentilesAggregatio } if (percent == previousPercent) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.AGGREGATIONS, "percents", "percent [{}] has been specified more than once, percents must be unique", diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java index 2fbc52cbe712..cdd71c010cf9 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java @@ -291,7 +291,7 @@ public class MovAvgPipelineAggregationBuilder extends AbstractPipelineAggregatio Integer predict = null; Boolean minimize = null; - DEPRECATION_LOGGER.deprecate( + DEPRECATION_LOGGER.critical( DeprecationCategory.AGGREGATIONS, "moving_avg_aggregation", "The moving_avg aggregation has been deprecated in favor of the moving_fn aggregation." diff --git a/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java index 42e649bcf3d8..abd906af54ad 100644 --- a/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java @@ -1162,7 +1162,7 @@ public final class SearchSourceBuilder implements Writeable, ToXContentObject, R if (parsedSize != -1) { size(parsedSize); } else { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.API, "search-api-size-1", "Using search size of -1 is deprecated and will be removed in future versions. " @@ -1217,7 +1217,7 @@ public final class SearchSourceBuilder implements Writeable, ToXContentObject, R scriptFields.add(new ScriptField(parser)); } } else if (INDICES_BOOST_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { - deprecationLogger.deprecate(DeprecationCategory.API, "indices_boost_object_format", + deprecationLogger.critical(DeprecationCategory.API, "indices_boost_object_format", "Object format in indices_boost is deprecated, please use array format instead"); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchDocValuesPhase.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchDocValuesPhase.java index 1fe43794ce6e..be8d1eaa74be 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchDocValuesPhase.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchDocValuesPhase.java @@ -41,7 +41,7 @@ public final class FetchDocValuesPhase implements FetchSubPhase { if (context.docValuesContext().fields().stream() .map(f -> f.format) .anyMatch(USE_DEFAULT_FORMAT::equals)) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.API, "explicit_default_format", + DEPRECATION_LOGGER.critical(DeprecationCategory.API, "explicit_default_format", "[" + USE_DEFAULT_FORMAT + "] is a special format that was only used to " + "ease the transition to 7.x. It has become the default and shouldn't be set explicitly anymore."); } diff --git a/server/src/main/java/org/elasticsearch/search/lookup/LeafDocLookup.java b/server/src/main/java/org/elasticsearch/search/lookup/LeafDocLookup.java index ad15d69ceafc..732e05f6966f 100644 --- a/server/src/main/java/org/elasticsearch/search/lookup/LeafDocLookup.java +++ b/server/src/main/java/org/elasticsearch/search/lookup/LeafDocLookup.java @@ -54,7 +54,7 @@ public class LeafDocLookup implements Map> { public ScriptDocValues get(Object key) { // deprecate _type if ("_type".equals(key)) { - DEPRECATION_LOGGER.deprecate(DeprecationCategory.SCRIPTING, TYPES_DEPRECATION_KEY, TYPES_DEPRECATION_MESSAGE); + DEPRECATION_LOGGER.critical(DeprecationCategory.SCRIPTING, TYPES_DEPRECATION_KEY, TYPES_DEPRECATION_MESSAGE); } // assume its a string... String fieldName = key.toString(); diff --git a/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java b/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java index a35c343996b5..f744ed1c2190 100644 --- a/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java @@ -275,7 +275,7 @@ public class SliceBuilder implements Writeable, ToXContentObject { if (context.getIndexSettings().getIndexVersionCreated().onOrAfter(Version.V_7_0_0)) { throw new IllegalArgumentException("Computing slices on the [_uid] field is illegal for 7.x indices, use [_id] instead"); } - DEPRECATION_LOG.deprecate(DeprecationCategory.API, "slice_on_uid", + DEPRECATION_LOG.critical(DeprecationCategory.API, "slice_on_uid", "Computing slices on the [_uid] field is deprecated for 6.x indices, use [_id] instead"); // on new indices, the _id acts as a _uid return new TermsSliceQuery(IdFieldMapper.NAME, id, max); diff --git a/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java index 3ebc2ab21467..b0ae237d82b3 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/FieldSortBuilder.java @@ -736,7 +736,7 @@ public class FieldSortBuilder extends SortBuilder { static { PARSER.declareField(FieldSortBuilder::missing, XContentParser::objectText, MISSING, ValueType.VALUE); PARSER.declareString((fieldSortBuilder, nestedPath) -> { - deprecationLogger.deprecate(DeprecationCategory.API, "field_sort_nested_path", + deprecationLogger.critical(DeprecationCategory.API, "field_sort_nested_path", "[nested_path] has been deprecated in favor of the [nested] parameter"); fieldSortBuilder.setNestedPath(nestedPath); }, NESTED_PATH_FIELD); @@ -744,7 +744,7 @@ public class FieldSortBuilder extends SortBuilder { PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)) , ORDER_FIELD); PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORT_MODE); PARSER.declareObject(FieldSortBuilder::setNestedFilter, (p, c) -> { - deprecationLogger.deprecate(DeprecationCategory.API, "field_sort_nested_filter", + deprecationLogger.critical(DeprecationCategory.API, "field_sort_nested_filter", "[nested_filter] has been deprecated in favour for the [nested] parameter"); return SortBuilder.parseNestedFilter(p); }, NESTED_FILTER_FIELD); diff --git a/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java index 0a6569f64bc5..9114a266d766 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java @@ -483,7 +483,7 @@ public class GeoDistanceSortBuilder extends SortBuilder fieldName = currentName; } else if (token == XContentParser.Token.START_OBJECT) { if (NESTED_FILTER_FIELD.match(currentName, parser.getDeprecationHandler())) { - deprecationLogger.deprecate(DeprecationCategory.API, "geo_distance_nested_filter", + deprecationLogger.critical(DeprecationCategory.API, "geo_distance_nested_filter", "[nested_filter] has been deprecated in favour of the [nested] parameter"); nestedFilter = parseInnerQueryBuilder(parser); } else if (NESTED_FIELD.match(currentName, parser.getDeprecationHandler())) { @@ -514,7 +514,7 @@ public class GeoDistanceSortBuilder extends SortBuilder } else if (SORTMODE_FIELD.match(currentName, parser.getDeprecationHandler())) { sortMode = SortMode.fromString(parser.text()); } else if (NESTED_PATH_FIELD.match(currentName, parser.getDeprecationHandler())) { - deprecationLogger.deprecate(DeprecationCategory.API, "geo_distance_nested_path", + deprecationLogger.critical(DeprecationCategory.API, "geo_distance_nested_path", "[nested_path] has been deprecated in favour of the [nested] parameter"); nestedPath = parser.text(); } else if (IGNORE_UNMAPPED.match(currentName, parser.getDeprecationHandler())) { diff --git a/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java b/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java index e70d5721c459..8e5c4d6d739c 100644 --- a/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java @@ -272,12 +272,12 @@ public class ScriptSortBuilder extends SortBuilder { PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)), ORDER_FIELD); PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORTMODE_FIELD); PARSER.declareString((fieldSortBuilder, nestedPath) -> { - deprecationLogger.deprecate(DeprecationCategory.API, "script_nested_path", + deprecationLogger.critical(DeprecationCategory.API, "script_nested_path", "[nested_path] has been deprecated in favor of the [nested] parameter"); fieldSortBuilder.setNestedPath(nestedPath); }, NESTED_PATH_FIELD); PARSER.declareObject(ScriptSortBuilder::setNestedFilter, (p, c) -> { - deprecationLogger.deprecate(DeprecationCategory.API, "script_nested_filter", + deprecationLogger.critical(DeprecationCategory.API, "script_nested_filter", "[nested_filter] has been deprecated in favour for the [nested] parameter"); return SortBuilder.parseNestedFilter(p); }, NESTED_FILTER_FIELD); diff --git a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java index 67f4a455a195..f4352998cd17 100644 --- a/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java +++ b/server/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java @@ -280,7 +280,7 @@ public class GeoContextMapping extends ContextMapping { MappedFieldType mappedFieldType = fieldResolver.apply(fieldName); if (mappedFieldType == null) { if (indexVersionCreated.before(Version.V_7_0_0)) { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "geo_context_mapping", + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "geo_context_mapping", "field [{}] referenced in context [{}] is not defined in the mapping", fieldName, name); } else { throw new ElasticsearchParseException( @@ -288,7 +288,7 @@ public class GeoContextMapping extends ContextMapping { } } else if (GeoPointFieldMapper.CONTENT_TYPE.equals(mappedFieldType.typeName()) == false) { if (indexVersionCreated.before(Version.V_7_0_0)) { - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "geo_context_mapping", + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "geo_context_mapping", "field [{}] referenced in context [{}] must be mapped to geo_point, found [{}]", fieldName, name, mappedFieldType.typeName()); } else { diff --git a/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java b/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java index 2f7cabce9f2f..0e6897e0ede5 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/RestoreService.java @@ -395,7 +395,7 @@ public class RestoreService implements ClusterStateApplier { // log a deprecation warning if the any of the indexes to delete were included in the request and the snapshot // is from a version that should have feature states if (snapshotInfo.version().onOrAfter(FEATURE_STATES_VERSION) && explicitlyRequestedSystemIndices.isEmpty() == false) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.API, "restore-system-index-from-snapshot", "Restoring system indices by name is deprecated. Use feature states instead. System indices: " diff --git a/server/src/main/java/org/elasticsearch/transport/TransportInfo.java b/server/src/main/java/org/elasticsearch/transport/TransportInfo.java index fb00ccd98d40..6e3972d7e7a1 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportInfo.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportInfo.java @@ -92,7 +92,7 @@ public class TransportInfo implements ReportingService.Info { if (cnameInPublishAddress) { publishAddressString = hostString + '/' + publishAddress.toString(); } else { - deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "cname_in_publish_address", + deprecationLogger.critical(DeprecationCategory.SETTINGS, "cname_in_publish_address", propertyName + " was printed as [ip:port] instead of [hostname/ip:port]. " + "This format is deprecated and will change to [hostname/ip:port] in a future version. " + "Use -Des.transport.cname_in_publish_address=true to enforce non-deprecated formatting." diff --git a/server/src/main/java/org/elasticsearch/transport/TransportService.java b/server/src/main/java/org/elasticsearch/transport/TransportService.java index 0613841f81f4..44dc287bac15 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportService.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportService.java @@ -245,7 +245,7 @@ public class TransportService extends AbstractLifecycleComponent if (PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS) { logger.warn("transport handshakes from incompatible builds are unsafely permitted on this node; remove system property [" + PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS_KEY + "] to resolve this warning"); - DeprecationLogger.getLogger(TransportService.class).deprecate(DeprecationCategory.OTHER, + DeprecationLogger.getLogger(TransportService.class).critical(DeprecationCategory.OTHER, "permit_handshake_from_incompatible_builds", "system property [" + PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS_KEY + "] is deprecated and should be removed"); } diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java index 145410931a45..ab48d30b9d4f 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java @@ -108,14 +108,14 @@ public class TransportAnalyzeActionTests extends ESTestCase { @Override public TokenStream create(TokenStream tokenStream) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "deprecated_token_filter_create", + deprecationLogger.critical(DeprecationCategory.OTHER, "deprecated_token_filter_create", "Using deprecated token filter [deprecated]"); return tokenStream; } @Override public TokenStream normalize(TokenStream tokenStream) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "deprecated_token_filter_normalize", + deprecationLogger.critical(DeprecationCategory.OTHER, "deprecated_token_filter_normalize", "Using deprecated token filter [deprecated]"); return tokenStream; } diff --git a/server/src/test/java/org/elasticsearch/index/analysis/AnalysisRegistryTests.java b/server/src/test/java/org/elasticsearch/index/analysis/AnalysisRegistryTests.java index e9c831d15f6a..47c290068c86 100644 --- a/server/src/test/java/org/elasticsearch/index/analysis/AnalysisRegistryTests.java +++ b/server/src/test/java/org/elasticsearch/index/analysis/AnalysisRegistryTests.java @@ -315,7 +315,7 @@ public class AnalysisRegistryTests extends ESTestCase { @Override public TokenStream create(TokenStream tokenStream) { if (indexSettings.getIndexVersionCreated().equals(Version.CURRENT)) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "deprecated_token_filter", + deprecationLogger.critical(DeprecationCategory.OTHER, "deprecated_token_filter", "Using deprecated token filter [deprecated]"); } return tokenStream; @@ -344,7 +344,7 @@ public class AnalysisRegistryTests extends ESTestCase { @Override public TokenStream create(TokenStream tokenStream) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "unused_token_filter", "Using deprecated token filter [unused]"); + deprecationLogger.critical(DeprecationCategory.OTHER, "unused_token_filter", "Using deprecated token filter [unused]"); return tokenStream; } } @@ -357,7 +357,7 @@ public class AnalysisRegistryTests extends ESTestCase { @Override public TokenStream create(TokenStream tokenStream) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "deprecated_normalizer", + deprecationLogger.critical(DeprecationCategory.OTHER, "deprecated_normalizer", "Using deprecated token filter [deprecated_normalizer]"); return tokenStream; } diff --git a/server/src/test/java/org/elasticsearch/rest/DeprecationRestHandlerTests.java b/server/src/test/java/org/elasticsearch/rest/DeprecationRestHandlerTests.java index fe2b9bd9b2d1..782583f03d22 100644 --- a/server/src/test/java/org/elasticsearch/rest/DeprecationRestHandlerTests.java +++ b/server/src/test/java/org/elasticsearch/rest/DeprecationRestHandlerTests.java @@ -70,7 +70,7 @@ public class DeprecationRestHandlerTests extends ESTestCase { InOrder inOrder = inOrder(handler, request, channel, deprecationLogger); // log, then forward - inOrder.verify(deprecationLogger).deprecate(DeprecationCategory.API,"deprecated_route_GET_/some/path", deprecationMessage); + inOrder.verify(deprecationLogger).critical(DeprecationCategory.API,"deprecated_route_GET_/some/path", deprecationMessage); inOrder.verify(handler).handleRequest(request, channel, client); inOrder.verifyNoMoreInteractions(); } diff --git a/test/logger-usage/src/test/java/org/elasticsearch/test/loggerusage/ESLoggerUsageTests.java b/test/logger-usage/src/test/java/org/elasticsearch/test/loggerusage/ESLoggerUsageTests.java index 1eb1e5a0d001..2b7853112cf9 100644 --- a/test/logger-usage/src/test/java/org/elasticsearch/test/loggerusage/ESLoggerUsageTests.java +++ b/test/logger-usage/src/test/java/org/elasticsearch/test/loggerusage/ESLoggerUsageTests.java @@ -237,7 +237,7 @@ public class ESLoggerUsageTests extends ESTestCase { public void checkDeprecationLogger() { DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ESLoggerUsageTests.class); - deprecationLogger.deprecate(DeprecationCategory.OTHER, "key","message {}", 123); + deprecationLogger.critical(DeprecationCategory.OTHER, "key","message {}", 123); } } diff --git a/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java b/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java index 899e49208a54..c6582432e991 100644 --- a/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java +++ b/x-pack/plugin/async-search/qa/rest/src/main/java/org/elasticsearch/query/DeprecatedQueryBuilder.java @@ -55,7 +55,7 @@ public class DeprecatedQueryBuilder extends AbstractQueryBuilder groupedListener.onResponse(new Tuple<>(indexToFollow, error))); } else { if (indexAbstraction.isSystem()) { - deprecationLogger.deprecate(DeprecationCategory.INDICES, + deprecationLogger.critical(DeprecationCategory.INDICES, "ccr_auto_follow_system_indices", "Auto following a leader system index " + indexToFollow.getName() + " will not work in the next major version" diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java index 5653834da363..16f2ad5f3947 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java @@ -372,7 +372,7 @@ public class XPackPlugin extends XPackClientPlugin if (Files.exists(config) == false) { Path legacyConfig = env.configFile().resolve("x-pack").resolve(name); if (Files.exists(legacyConfig)) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "config_file_path", + deprecationLogger.critical(DeprecationCategory.OTHER, "config_file_path", "Config file [" + name + "] is in a deprecated location. Move from " + legacyConfig.toString() + " to " + config.toString()); return legacyConfig; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleType.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleType.java index e6ba5945531a..4b6e1693504e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleType.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleType.java @@ -309,7 +309,7 @@ public class TimeseriesLifecycleType implements LifecycleType { private void logDeprecationWarningForFreezeAction(Collection phases) { if (phases.stream().anyMatch(phase -> phase.getActions().containsKey(FreezeAction.NAME))) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "ilm_freee_action", FREEZE_ACTION_DEPRECATION_WARNING); + deprecationLogger.critical(DeprecationCategory.OTHER, "ilm_freee_action", FREEZE_ACTION_DEPRECATION_WARNING); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java index 96f7d6a4e321..1f3e89940390 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/datafeed/DatafeedUpdate.java @@ -373,7 +373,7 @@ public class DatafeedUpdate implements Writeable, ToXContentObject { DatafeedConfig.Builder builder = new DatafeedConfig.Builder(datafeedConfig); if (jobId != null) { if (datafeedConfig.getJobId() != null && datafeedConfig.getJobId().equals(jobId) == false) { - deprecationLogger.deprecate(DeprecationCategory.API, "update_datafeed_job_id", DEPRECATION_MESSAGE_ON_JOB_ID_UPDATE); + deprecationLogger.critical(DeprecationCategory.API, "update_datafeed_job_id", DEPRECATION_MESSAGE_ON_JOB_ID_UPDATE); } builder.setJobId(jobId); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java index 18e5bd035548..2dcde1f77ee5 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java @@ -356,7 +356,7 @@ public final class IndicesPermission { for (String privilegeName : group.privilege.name()) { if (PRIVILEGE_NAME_SET_BWC_ALLOW_MAPPING_UPDATE.contains(privilegeName)) { bwcDeprecationLogActions.add(() -> { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SECURITY, "[" + resource.name + "] mapping update for ingest privilege [" + privilegeName + "]", "the index privilege [" diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/SSLService.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/SSLService.java index a89d75ba11d2..6ed50875c86a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/SSLService.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/SSLService.java @@ -546,7 +546,7 @@ public class SSLService { // Client Authentication _should_ be required, but if someone turns it off, then this check is no longer relevant final SSLConfigurationSettings configurationSettings = SSLConfigurationSettings.withPrefix(prefix + "."); if (isConfigurationValidForServerUsage(configuration) == false) { - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "invalid_ssl_configuration", + deprecationLogger.critical(DeprecationCategory.SECURITY, "invalid_ssl_configuration", "invalid SSL configuration for " + prefix + " - server ssl configuration requires a key and certificate, but these have not been configured; you must set either " + "[" + configurationSettings.x509KeyPair.keystorePath.getKey() + "], or both [" + @@ -559,7 +559,7 @@ public class SSLService { .sorted() .collect(Collectors.toList()); if (sslSettingNames.isEmpty() == false) { - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "invalid_ssl_configuration", + deprecationLogger.critical(DeprecationCategory.SECURITY, "invalid_ssl_configuration", "invalid configuration for " + prefix + " - [" + enabledSetting + "] is not set, but the following settings have been configured in elasticsearch.yml : [" + Strings.collectionToCommaDelimitedString(sslSettingNames) + "]"); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java index 088e62d82800..11060e5c2cbb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/action/GetTransformAction.java @@ -125,7 +125,7 @@ public class GetTransformAction extends ActionType builder.field(TransformField.COUNT.getPreferredName(), invalidTransforms.size()); builder.field(TransformField.TRANSFORMS.getPreferredName(), invalidTransforms); builder.endObject(); - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.OTHER, "invalid_transforms", INVALID_TRANSFORMS_DEPRECATION_WARNING, diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java index c7da3321cad8..22e627c260f1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/PivotConfig.java @@ -88,7 +88,7 @@ public class PivotConfig implements Writeable, ToXContentObject { this.maxPageSearchSize = maxPageSearchSize; if (maxPageSearchSize != null) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.API, TransformField.MAX_PAGE_SEARCH_SIZE.getPreferredName(), "[max_page_search_size] is deprecated inside pivot please use settings instead" diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java index 47ee429eaa39..ccf11eb1167d 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedAggregationBuilder.java @@ -97,7 +97,7 @@ public class MockDeprecatedAggregationBuilder extends ValuesSourceAggregationBui } public static MockDeprecatedAggregationBuilder fromXContent(XContentParser p) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "deprecated_mock", DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.OTHER, "deprecated_mock", DEPRECATION_MESSAGE); return new MockDeprecatedAggregationBuilder(); } } diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java index 622f0d00c6a7..acbc8f655092 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/MockDeprecatedQueryBuilder.java @@ -46,7 +46,7 @@ public class MockDeprecatedQueryBuilder extends AbstractQueryBuilder { + Response response; + try { + client().performRequest(new Request("POST", "/" + DATA_STREAM_NAME + "/_refresh?ignore_unavailable=true")); + response = client().performRequest(new Request("GET", "/" + DATA_STREAM_NAME + "/_search")); + } catch (Exception e) { + // It can take a moment for the index to be created. If it doesn't exist then the client + // throws an exception. Translate it into an assertion error so that assertBusy() will + // continue trying. + throw new AssertionError(e); + } + assertOK(response); + + ObjectMapper mapper = new ObjectMapper(); + final JsonNode jsonNode = mapper.readTree(response.getEntity().getContent()); + + final int hits = jsonNode.at("/hits/total/value").intValue(); + assertThat(hits, greaterThan(0)); + + List> documents = new ArrayList<>(); + + for (int i = 0; i < hits; i++) { + final JsonNode hit = jsonNode.at("/hits/hits/" + i + "/_source"); + + final Map document = new HashMap<>(); + hit.fields().forEachRemaining(entry -> document.put(entry.getKey(), entry.getValue().textValue())); + + documents.add(document); + } + + logger.warn(documents); + assertThat(documents, hasSize(2)); + + assertThat( + documents, + hasItems( + allOf( + hasKey("@timestamp"), + hasKey("elasticsearch.cluster.name"), + hasKey("elasticsearch.cluster.uuid"), + hasEntry("elasticsearch.http.request.x_opaque_id", "some xid"), + hasEntry("elasticsearch.event.category", "settings"), + hasKey("elasticsearch.node.id"), + hasKey("elasticsearch.node.name"), + hasEntry("data_stream.dataset", "deprecation.elasticsearch"), + hasEntry("data_stream.namespace", "default"), + hasEntry("data_stream.type", "logs"), + hasEntry("ecs.version", "1.7"), + hasEntry("event.code", "deprecated_warn_settings"), + hasEntry("event.dataset", "deprecation.elasticsearch"), + hasEntry("log.level", "WARN"), + hasKey("log.logger"), + hasEntry("message", "[deprecated_warn_settings] usage is deprecated but won't be breaking in next version") + ), + allOf( + hasKey("@timestamp"), + hasKey("elasticsearch.cluster.name"), + hasKey("elasticsearch.cluster.uuid"), + hasEntry("elasticsearch.http.request.x_opaque_id", "some xid"), + hasEntry("elasticsearch.event.category", "api"), + hasKey("elasticsearch.node.id"), + hasKey("elasticsearch.node.name"), + hasEntry("data_stream.dataset", "deprecation.elasticsearch"), + hasEntry("data_stream.namespace", "default"), + hasEntry("data_stream.type", "logs"), + hasEntry("ecs.version", "1.7"), + hasEntry("event.code", "deprecated_route_GET_/_test_cluster/deprecated_settings"), + hasEntry("event.dataset", "deprecation.elasticsearch"), + hasEntry("log.level", "CRITICAL"), hasKey("log.logger"), hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests") ) @@ -424,10 +529,9 @@ public class DeprecationHttpIT extends ESRestTestCase { return warnings; } - private HttpEntity buildSettingsRequest(List> settings, boolean useDeprecatedField) throws IOException { + private HttpEntity buildSettingsRequest(List> settings, String settingName) throws IOException { XContentBuilder builder = JsonXContent.contentBuilder(); - - builder.startObject().startArray(useDeprecatedField ? "deprecated_settings" : "settings"); + builder.startObject().startArray(settingName); for (Setting setting : settings) { builder.value(setting.getKey()); diff --git a/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java b/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java index 19edd7d65d04..59f312d2d880 100644 --- a/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java +++ b/x-pack/plugin/deprecation/qa/rest/src/main/java/org/elasticsearch/xpack/deprecation/TestDeprecatedQueryBuilder.java @@ -67,7 +67,7 @@ public class TestDeprecatedQueryBuilder extends AbstractQueryBuilder source = parser.map(); - if (source.containsKey("deprecated_settings")) { - deprecationLogger.deprecate(DeprecationCategory.OTHER, "deprecated_settings", DEPRECATED_USAGE); - + deprecationLogger.critical(DeprecationCategory.SETTINGS, "deprecated_settings", DEPRECATED_USAGE); settings = (List) source.get("deprecated_settings"); + } else if (source.containsKey("deprecation_warning")) { + deprecationLogger.warn(DeprecationCategory.SETTINGS, "deprecated_warn_settings", DEPRECATED_WARN_USAGE); + settings = (List) source.get("deprecation_warning"); } else { settings = (List) source.get("settings"); } diff --git a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java index 58c13783380b..0c857fc6c54e 100644 --- a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java +++ b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java @@ -117,7 +117,7 @@ public class RestGraphAction extends XPackRestHandler { } if (request.hasParam("type")) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "graph_with_types", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "graph_with_types", TYPES_DEPRECATION_MESSAGE); graphRequest.types(Strings.splitStringByCommaToArray(request.param("type"))); } return channel -> client.es().execute(INSTANCE, graphRequest, new RestToXContentListener<>(channel)); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java index 144b544922a7..ff9eb18ff29b 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/JobManager.java @@ -302,7 +302,7 @@ public class JobManager { Job job = jobBuilder.build(new Date()); if (job.getDataDescription() != null && job.getDataDescription().getFormat() == DataDescription.DataFormat.DELIMITED) { - deprecationLogger.deprecate(DeprecationCategory.API, "ml_create_job_delimited_data", + deprecationLogger.critical(DeprecationCategory.API, "ml_create_job_delimited_data", "Creating jobs with delimited data format is deprecated. Please use xcontent instead."); } diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java index 80760b73d288..e5cd3a123c71 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java @@ -75,7 +75,7 @@ public class RestGetTrainedModelsAction extends BaseRestHandler { Strings.EMPTY_ARRAY))); final GetTrainedModelsAction.Request request; if (restRequest.hasParam(GetTrainedModelsAction.Request.INCLUDE_MODEL_DEFINITION)) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.API, GetTrainedModelsAction.Request.INCLUDE_MODEL_DEFINITION, "[{}] parameter is deprecated! Use [include=definition] instead.", diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/DomainSplitFunction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/DomainSplitFunction.java index 4a9156a63b95..ab17f713c9b1 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/DomainSplitFunction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/utils/DomainSplitFunction.java @@ -163,7 +163,7 @@ public final class DomainSplitFunction { public static List domainSplit(String host, Map params) { // NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts AccessController.doPrivileged((PrivilegedAction) () -> { - deprecationLogger.deprecate(DeprecationCategory.API, "domainSplit", + deprecationLogger.critical(DeprecationCategory.API, "domainSplit", "Method [domainSplit] taking params is deprecated. Remove the params argument."); return null; }); diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java index 038bd80abfe8..3d4bf29ba755 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java @@ -119,7 +119,7 @@ public class TransportPutRollupJobAction extends AcknowledgedTransportMasterNode String timeZone = request.getConfig().getGroupConfig().getDateHistogram().getTimeZone(); String modernTZ = DateUtils.DEPRECATED_LONG_TIMEZONES.get(timeZone); if (modernTZ != null) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.API, "deprecated_timezone", "Creating Rollup job [" diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheService.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheService.java index 28271b2ab69a..5dd21cd2441c 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheService.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/FrozenCacheService.java @@ -134,7 +134,7 @@ public class FrozenCacheService implements Releasable { @SuppressWarnings("unchecked") final List roles = (List) settings.get(NodeRoleSettings.NODE_ROLES_SETTING); if (DataTier.isFrozenNode(new HashSet<>(roles)) == false) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SETTINGS, "shared_cache", "setting [{}] to be positive [{}] on node without the data_frozen role is deprecated, roles are [{}]", diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java index 157f5480d5d8..995eca9e6e66 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java @@ -885,21 +885,21 @@ public class ApiKeyService { @Override public void usedDeprecatedName(String parserName, Supplier location, String usedName, String modernName) { String prefix = parserName == null ? "" : "[" + parserName + "][" + location.get() + "] "; - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "api_key_field", + deprecationLogger.critical(DeprecationCategory.SECURITY, "api_key_field", "{}Deprecated field [{}] used in api key [{}], expected [{}] instead", prefix, usedName, apiKeyId, modernName); } @Override public void usedDeprecatedField(String parserName, Supplier location, String usedName, String replacedWith) { String prefix = parserName == null ? "" : "[" + parserName + "][" + location.get() + "] "; - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "api_key_field", + deprecationLogger.critical(DeprecationCategory.SECURITY, "api_key_field", "{}Deprecated field [{}] used in api key [{}], replaced by [{}]", prefix, usedName, apiKeyId, replacedWith); } @Override public void usedDeprecatedField(String parserName, Supplier location, String usedName) { String prefix = parserName == null ? "" : "[" + parserName + "][" + location.get() + "] "; - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "api_key_field", + deprecationLogger.critical(DeprecationCategory.SECURITY, "api_key_field", "{}Deprecated field [{}] used in api key [{}], which is unused and will be removed entirely", prefix, usedName, apiKeyId); } } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/Realms.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/Realms.java index 2fb881f67b40..0ab835bbd5a9 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/Realms.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/Realms.java @@ -435,7 +435,7 @@ public class Realms implements Iterable { private void logDeprecationIfFound(Set missingOrderRealmSettingKeys, Map> orderToRealmOrderSettingKeys) { if (missingOrderRealmSettingKeys.size() > 0) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SECURITY, "unordered_realm_config", "Found realms without order config: [{}]. In next major release, node will fail to start with missing realm order.", @@ -449,7 +449,7 @@ public class Realms implements Iterable { .sorted() .collect(Collectors.toList()); if (false == duplicatedRealmOrderSettingKeys.isEmpty()) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SECURITY, "duplicate_realm_order", "Found multiple realms configured with the same order: [{}]. " @@ -468,7 +468,7 @@ public class Realms implements Iterable { if (explicitlyDisabledBasicRealms.isEmpty()) { return; } - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SECURITY, "implicitly_disabled_basic_realms", "Found explicitly disabled basic {}: [{}]. But {} will be enabled because no other realms are configured or enabled. " @@ -481,7 +481,7 @@ public class Realms implements Iterable { if (unconfiguredBasicRealms.isEmpty()) { return; } - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SECURITY, "implicitly_disabled_basic_realms", "Found implicitly disabled basic {}: [{}]. {} disabled because there are other explicitly configured realms. " @@ -495,7 +495,7 @@ public class Realms implements Iterable { private void logDeprecationForReservedPrefixedRealmNames(List realmIdentifiers) { if (false == realmIdentifiers.isEmpty()) { - deprecationLogger.deprecate( + deprecationLogger.critical( DeprecationCategory.SECURITY, "realm_name_with_reserved_prefix", "Found realm " diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeRealmMigrateTool.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeRealmMigrateTool.java index a1c220eb3f9e..a8b0ab796468 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeRealmMigrateTool.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ESNativeRealmMigrateTool.java @@ -9,9 +9,10 @@ package org.elasticsearch.xpack.security.authc.esnative; import joptsimple.OptionParser; import joptsimple.OptionSet; import joptsimple.OptionSpec; + import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.Appender; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.LoggerContext; @@ -24,9 +25,7 @@ import org.elasticsearch.cli.EnvironmentAwareCommand; import org.elasticsearch.cli.LoggingAwareMultiCommand; import org.elasticsearch.cli.Terminal; import org.elasticsearch.cli.Terminal.Verbosity; -import org.elasticsearch.core.Nullable; import org.elasticsearch.common.Strings; -import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.settings.SecureString; import org.elasticsearch.common.settings.Settings; @@ -37,17 +36,17 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.core.Nullable; +import org.elasticsearch.core.SuppressForbidden; import org.elasticsearch.env.Environment; import org.elasticsearch.xpack.core.common.socket.SocketAccess; import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken; import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.ssl.SSLConfiguration; -import org.elasticsearch.xpack.security.authz.store.FileRolesStore; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.security.authc.file.FileUserPasswdStore; import org.elasticsearch.xpack.security.authc.file.FileUserRolesStore; - -import javax.net.ssl.HttpsURLConnection; +import org.elasticsearch.xpack.security.authz.store.FileRolesStore; import java.io.BufferedReader; import java.io.FileNotFoundException; @@ -66,6 +65,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Map; import java.util.Set; +import javax.net.ssl.HttpsURLConnection; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -375,16 +375,13 @@ public class ESNativeRealmMigrateTool extends LoggingAwareMultiCommand { .build()) { @Override public void append(LogEvent event) { - switch (event.getLevel().getStandardLevel()) { - case FATAL: - case ERROR: - terminal.println(Verbosity.NORMAL, event.getMessage().getFormattedMessage()); - break; - case OFF: - break; - default: - terminal.println(Verbosity.VERBOSE, event.getMessage().getFormattedMessage()); - break; + if (event.getLevel().equals(Level.OFF)) { + return; + } + if (event.getLevel().isMoreSpecificThan(Level.ERROR)) { + terminal.println(Verbosity.NORMAL, event.getMessage().getFormattedMessage()); + } else { + terminal.println(Verbosity.VERBOSE, event.getMessage().getFormattedMessage()); } } }; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java index d1242f08ff4e..f4bd75548769 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/esnative/ReservedRealm.java @@ -234,7 +234,7 @@ public class ReservedRealm extends CachingUsernamePasswordRealm { private void logDeprecatedUser(final User user){ Map metadata = user.metadata(); if (Boolean.TRUE.equals(metadata.get(MetadataUtils.DEPRECATED_METADATA_KEY))) { - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "deprecated_user-" + user.principal(), + deprecationLogger.critical(DeprecationCategory.SECURITY, "deprecated_user-" + user.principal(), "The user [" + user.principal() + "] is deprecated and will be removed in a future version of Elasticsearch. " + metadata.get(MetadataUtils.DEPRECATED_REASON_METADATA_KEY)); } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/ActiveDirectorySessionFactory.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/ActiveDirectorySessionFactory.java index 69e82afc86be..6c7b2a7ec0b5 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/ActiveDirectorySessionFactory.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/ActiveDirectorySessionFactory.java @@ -528,7 +528,7 @@ class ActiveDirectorySessionFactory extends PoolingSessionFactory { super(config, timeout, ignoreReferralErrors, logger, groupsResolver, metadataResolver, domainDN, ActiveDirectorySessionFactorySettings.AD_UPN_USER_SEARCH_FILTER_SETTING, UPN_USER_FILTER, threadPool); if (userSearchFilter.contains("{0}")) { - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "ldap_settings", + deprecationLogger.critical(DeprecationCategory.SECURITY, "ldap_settings", "The use of the account name variable {0} in the setting [" + RealmSettings.getFullSettingKey(config, ActiveDirectorySessionFactorySettings.AD_UPN_USER_SEARCH_FILTER_SETTING) + "] has been deprecated and will be removed in a future version!"); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/SessionFactory.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/SessionFactory.java index c62a319c53cf..6bc1c771da15 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/SessionFactory.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/SessionFactory.java @@ -161,7 +161,7 @@ public abstract class SessionFactory { } else if (hostnameVerificationExists) { final String fullSettingKey = RealmSettings.getFullSettingKey(config, SessionFactorySettings.HOSTNAME_VERIFICATION_SETTING); final String deprecationKey = "deprecated_setting_" + fullSettingKey.replace('.', '_'); - DeprecationLogger.getLogger(logger.getName()).deprecate(DeprecationCategory.SECURITY, deprecationKey, + DeprecationLogger.getLogger(logger.getName()).critical(DeprecationCategory.SECURITY, deprecationKey, "the setting [{}] has been deprecated and will be removed in a future version. use [{}] instead", fullSettingKey, RealmSettings.getFullSettingKey(config, SSLConfigurationSettings.VERIFICATION_MODE_SETTING_REALM)); if (config.getSetting(SessionFactorySettings.HOSTNAME_VERIFICATION_SETTING)) { diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStore.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStore.java index 49a2c6af51c7..37d77dbda001 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStore.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/CompositeRolesStore.java @@ -201,7 +201,7 @@ public class CompositeRolesStore { .forEach(rd -> { String reason = Objects.toString( rd.getMetadata().get(MetadataUtils.DEPRECATED_REASON_METADATA_KEY), "Please check the documentation"); - deprecationLogger.deprecate(DeprecationCategory.SECURITY, "deprecated_role-" + rd.getName(), + deprecationLogger.critical(DeprecationCategory.SECURITY, "deprecated_role-" + rd.getName(), "The role [" + rd.getName() + "] is deprecated and will be removed in a future version of Elasticsearch. " + reason); }); } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/DeprecationRoleDescriptorConsumer.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/DeprecationRoleDescriptorConsumer.java index a5888e0c5674..a631d9616081 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/DeprecationRoleDescriptorConsumer.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/store/DeprecationRoleDescriptorConsumer.java @@ -207,7 +207,7 @@ public final class DeprecationRoleDescriptorConsumer implements Consumer @Override public ShapeFieldMapper build(MapperBuilderContext context) { if (multiFieldsBuilder.hasMultiFields()) { - DEPRECATION_LOGGER.deprecate( + DEPRECATION_LOGGER.critical( DeprecationCategory.MAPPINGS, "shape_multifields", "Adding multifields to [shape] mappers has no effect and will be forbidden in future" diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java index 3e497b449495..5c578cd7ad29 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java @@ -158,7 +158,7 @@ public class ShapeQueryBuilder extends AbstractGeometryQueryBuilder { - deprecationLogger.deprecate(DeprecationCategory.API, "sparse_vector", DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.API, "sparse_vector", DEPRECATION_MESSAGE); return new Builder(n, c.indexVersionCreated()); }, notInMultiFields(CONTENT_TYPE)); diff --git a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/ScoreScriptUtils.java b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/ScoreScriptUtils.java index 714522776a03..1dede6fc6f7d 100644 --- a/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/ScoreScriptUtils.java +++ b/x-pack/plugin/vectors/src/main/java/org/elasticsearch/xpack/vectors/query/ScoreScriptUtils.java @@ -65,7 +65,7 @@ public class ScoreScriptUtils { docValues = (DenseVectorScriptDocValues) scoreScript.getDoc().get(fieldName); } else if (field instanceof DenseVectorScriptDocValues) { docValues = (DenseVectorScriptDocValues) field; - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "vector_function_signature", DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "vector_function_signature", DEPRECATION_MESSAGE); } else { throw new IllegalArgumentException("For vector functions, the 'field' argument must be of type String or " + "VectorScriptDocValues"); @@ -223,13 +223,13 @@ public class ScoreScriptUtils { docValues = (SparseVectorScriptDocValues) scoreScript.getDoc().get(fieldName); } else if (field instanceof SparseVectorScriptDocValues) { docValues = (SparseVectorScriptDocValues) field; - deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "vector_function_signature", DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.SCRIPTING, "vector_function_signature", DEPRECATION_MESSAGE); } else { throw new IllegalArgumentException("For vector functions, the 'field' argument must be of type String or " + "VectorScriptDocValues"); } - deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "sparse_vector_function", + deprecationLogger.critical(DeprecationCategory.MAPPINGS, "sparse_vector_function", SparseVectorFieldMapper.DEPRECATION_MESSAGE); } diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java index 5cfab973cfff..f2b4f646cbab 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java @@ -182,7 +182,7 @@ public class IndexAction implements Action { } } else if (token == XContentParser.Token.VALUE_STRING) { if (Field.DOC_TYPE.match(currentFieldName, parser.getDeprecationHandler())) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "watcher_index_action", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "watcher_index_action", TYPES_DEPRECATION_MESSAGE); docType = parser.text(); } else if (Field.DOC_ID.match(currentFieldName, parser.getDeprecationHandler())) { docId = parser.text(); diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java index a544bdf3dd2d..0c2f1d11aea9 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java @@ -60,7 +60,7 @@ public class RestWatcherStatsAction extends WatcherRestHandler { } if (metrics.contains("pending_watches")) { - deprecationLogger.deprecate(DeprecationCategory.API, "pending_watches", + deprecationLogger.critical(DeprecationCategory.API, "pending_watches", "The pending_watches parameter is deprecated, use queued_watches instead"); } diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java index e57fa856c795..8010e67348b9 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java @@ -198,7 +198,7 @@ public class WatcherSearchTemplateRequest implements ToXContentObject { } } } else if (TYPES_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "watcher_search_input", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "watcher_search_input", TYPES_DEPRECATION_MESSAGE); while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { if (token == XContentParser.Token.VALUE_STRING) { types.add(parser.textOrNull()); @@ -230,7 +230,7 @@ public class WatcherSearchTemplateRequest implements ToXContentObject { String indicesStr = parser.text(); indices.addAll(Arrays.asList(Strings.delimitedListToStringArray(indicesStr, ",", " \t"))); } else if (TYPES_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { - deprecationLogger.deprecate(DeprecationCategory.TYPES, "watcher_search_input", TYPES_DEPRECATION_MESSAGE); + deprecationLogger.critical(DeprecationCategory.TYPES, "watcher_search_input", TYPES_DEPRECATION_MESSAGE); String typesStr = parser.text(); types.addAll(Arrays.asList(Strings.delimitedListToStringArray(typesStr, ",", " \t"))); } else if (SEARCH_TYPE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {