Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TESTING.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ You can also use Gradle to prepare the test environment and then starts a single
gradle vagrantFedora24#up
-------------------------------------------------

Or any of vagrantCentos6#up, vagrantDebian8#up, vagrantFedora24#up, vagrantOel6#up,
Or any of vagrantCentos6#up, vagrantDebian8#up, vagrantCentos7#up, vagrantOel6#up,
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 inadvertent?

vagrantOel7#up, vagrantOpensuse13#up, vagrantSles12#up, vagrantUbuntu1204#up,
vagrantUbuntu1604#up.

Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/org/elasticsearch/cli/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public final int main(String[] args, Terminal terminal) throws Exception {

// initialize default for es.logger.level because we will not read the log4j2.properties
final String loggerLevel = System.getProperty("es.logger.level", Level.INFO.name());
final Settings settings = Settings.builder().put("logger.level", loggerLevel).build();
LogConfigurator.configureWithoutConfig(settings);
LogConfigurator.configureWithoutConfig(loggerLevel);

try {
mainWithoutErrorHandling(args, terminal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ public class LogConfigurator {
* Configure logging without reading a log4j2.properties file, effectively configuring the
* status logger and all loggers to the console.
*
* @param settings for configuring logger.level and individual loggers
* @param loggerLevel for configuring logger.level
*/
public static void configureWithoutConfig(final Settings settings) {
Objects.requireNonNull(settings);
public static void configureWithoutConfig(final String loggerLevel) {
Copy link
Member

Choose a reason for hiding this comment

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

This situation feels very fragile to me. It means in the future if we do want a settings instance here because we want to control fine-grained logging settings for a CLI tool, we can not without accidentally reintroducing the problem.

Objects.requireNonNull(loggerLevel);
// we initialize the status logger immediately otherwise Log4j will complain when we try to get the context
configureStatusLogger();

Settings settings = Settings.builder().put("logger.level", loggerLevel).build();
configureLoggerLevels(settings);
}

Expand Down