-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Allow not configure logging without config #26209
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For CLI tools, we configure logging without reading the log4j2.properties file. This because any log statements in a CLI tool should dump to the console while reading from the log4j2.properties file would cause them to dump whereever the log configuration there indicates (e.g., possibly a remote machine). To do this, we added some code to the base implementation of all CLI tools to configure logging without a config file. This code is also executed when Elasticsearch starts up. In the past this was fine yet we previously added detection to Elasticsearch to find cases where we use logging before it is configured. Because of configuring logging without a config, this means we only catch uses of logging before the logging without config is performed. To correct this, we enable a CLI tool to skip enabling logging without a config and then in the Elasticsearch CLI we indeed utilize this to skip configuring logging without a config.
jasontedor
added
:Core/Infra/Logging
Log management and logging utilities
>bug
review
v5.6.0
v6.0.0
v6.1.0
v7.0.0
labels
Aug 14, 2017
rjernst
approved these changes
Aug 14, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
jasontedor
added a commit
that referenced
this pull request
Aug 14, 2017
For CLI tools, we configure logging without reading the log4j2.properties file. This because any log statements in a CLI tool should dump to the console while reading from the log4j2.properties file would cause them to dump whereever the log configuration there indicates (e.g., possibly a remote machine). To do this, we added some code to the base implementation of all CLI tools to configure logging without a config file. This code is also executed when Elasticsearch starts up. In the past this was fine yet we previously added detection to Elasticsearch to find cases where we use logging before it is configured. Because of configuring logging without a config, this means we only catch uses of logging before the logging without config is performed. To correct this, we enable a CLI tool to skip enabling logging without a config and then in the Elasticsearch CLI we indeed utilize this to skip configuring logging without a config. Relates #26209
jasontedor
added a commit
that referenced
this pull request
Aug 14, 2017
For CLI tools, we configure logging without reading the log4j2.properties file. This because any log statements in a CLI tool should dump to the console while reading from the log4j2.properties file would cause them to dump whereever the log configuration there indicates (e.g., possibly a remote machine). To do this, we added some code to the base implementation of all CLI tools to configure logging without a config file. This code is also executed when Elasticsearch starts up. In the past this was fine yet we previously added detection to Elasticsearch to find cases where we use logging before it is configured. Because of configuring logging without a config, this means we only catch uses of logging before the logging without config is performed. To correct this, we enable a CLI tool to skip enabling logging without a config and then in the Elasticsearch CLI we indeed utilize this to skip configuring logging without a config. Relates #26209
jasontedor
added a commit
that referenced
this pull request
Aug 14, 2017
For CLI tools, we configure logging without reading the log4j2.properties file. This because any log statements in a CLI tool should dump to the console while reading from the log4j2.properties file would cause them to dump whereever the log configuration there indicates (e.g., possibly a remote machine). To do this, we added some code to the base implementation of all CLI tools to configure logging without a config file. This code is also executed when Elasticsearch starts up. In the past this was fine yet we previously added detection to Elasticsearch to find cases where we use logging before it is configured. Because of configuring logging without a config, this means we only catch uses of logging before the logging without config is performed. To correct this, we enable a CLI tool to skip enabling logging without a config and then in the Elasticsearch CLI we indeed utilize this to skip configuring logging without a config. Relates #26209
Thanks @rjernst. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For CLI tools, we configure logging without reading the log4j2.properties file. This because any log statements in a CLI tool should dump to the console while reading from the log4j2.properties file would cause them to dump whereever the log configuration there indicates (e.g., possibly a remote machine). To do this, we added some code to the base implementation of all CLI tools to configure logging without a config file. This code is also executed when Elasticsearch starts up. In the past this was fine yet we previously added detection to Elasticsearch to find cases where we use logging before it is configured. Because of configuring logging without a config, this means we only catch uses of logging before the logging without config is performed. To correct this, we enable a CLI tool to skip enabling logging without a config and then in the Elasticsearch CLI we indeed utilize this to skip configuring logging without a config.
Relates #20575, relates #24076