Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation logging for lenient booleans #22696

Merged

Conversation

jasontedor
Copy link
Member

@jasontedor jasontedor commented Jan 19, 2017

This commit fixes an issue with deprecation logging for lenient booleans. The underlying issue is that adding deprecation logging for lenient booleans added a static deprecation logger to the Settings class. However, the Settings class is initialized very early and in CLI tools can be initialized before logging is initialized. This leads to status logger error messages. Additionally, the deprecation logging for a lot of the settings does not provide useful context (for example, in the token filter factories, the deprecation logging only produces the name of the setting, but gives no context which token filter factory it comes from). This commit addresses both of these issues by changing the call sites to push a deprecation logger through to the lenient boolean parsing.

Relates #22200, supersedes #22687

This commit fixes an issue with deprecation logging for lenient
booleans. The underlying issue is that adding deprecation logging for
lenient booleans added a static deprecation logger to the Settings
class. However, the Settings class is initialized very early and in CLI
tools can be initialized before logging is initialized. This leads to
status logger error messages. Additionally, the deprecation logging for
a lot of the settings does not provide useful context (for example, in
the token filter factories, the deprecation logging only produces the
name of the setting, but gives no context which token filter factory it
comes from). This commit addresses both of these issues by changing the
call sites to push a deprecation logger through to the lenient boolean
parsing.
@jasontedor jasontedor force-pushed the lenient-boolean-deprecation-logging branch from 135bf9c to 0958752 Compare January 19, 2017 17:04
Copy link
Member

@danielmitterdorfer danielmitterdorfer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing! Left one minor question but LGTM.

As this depends on the backport of #22200 to 5.x, I'll take care of the backport of this too.

@@ -79,6 +81,8 @@

public class Analysis {

static final DeprecationLogger deprecationLogger = new DeprecationLogger(ESLoggerFactory.getLogger(Analysis.class));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this package private by intention?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm not sure what happened there, thanks for catching it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed db599a8.

@jasontedor jasontedor merged commit 9781b88 into elastic:master Jan 19, 2017
@jasontedor jasontedor deleted the lenient-boolean-deprecation-logging branch January 19, 2017 17:30
@jasontedor
Copy link
Member Author

Thanks @danielmitterdorfer.

danielmitterdorfer added a commit to danielmitterdorfer/elasticsearch that referenced this pull request Jan 20, 2017
Elasticsearch 6.0 removes support for lenient
booleans (see elastic#22000). With this commit we
deprecate all usages of non-strict booleans in
Elasticsearch 5.x so users can already spot
improper usages.

Relates elastic#22000
Relates elastic#22696
danielmitterdorfer added a commit that referenced this pull request Jan 23, 2017
Elasticsearch 6.0 removes support for lenient
booleans (see #22000). With this commit we
deprecate all usages of non-strict booleans in
Elasticsearch 5.x so users can already spot
improper usages.

Relates #22000
Relates #22696
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Logging Log management and logging utilities :Core/Infra/Settings Settings infrastructure and APIs >non-issue v5.3.0 v6.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants