From f3fb702e885a3d6ae5c1c549ad4948da12bd4e1b Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 8 Sep 2015 13:13:10 -0700 Subject: [PATCH] Move logging specific settings setup to log configurator. --- .../elasticsearch/common/logging/log4j/LogConfigurator.java | 3 +++ .../elasticsearch/node/internal/InternalSettingsPreparer.java | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java b/core/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java index d90b2f1f1bd..fb0e06a3bd5 100644 --- a/core/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java +++ b/core/src/main/java/org/elasticsearch/common/logging/log4j/LogConfigurator.java @@ -40,6 +40,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; +import static org.elasticsearch.common.Strings.cleanPath; import static org.elasticsearch.common.settings.Settings.settingsBuilder; /** @@ -110,6 +111,8 @@ public class LogConfigurator { props.setProperty(key, value); } } + // ensure explicit path to logs dir exists + props.put("path.logs", cleanPath(environment.logsFile().toAbsolutePath().toString())); PropertyConfigurator.configure(props); } diff --git a/core/src/main/java/org/elasticsearch/node/internal/InternalSettingsPreparer.java b/core/src/main/java/org/elasticsearch/node/internal/InternalSettingsPreparer.java index 9307e82f436..eb5e5136ff4 100644 --- a/core/src/main/java/org/elasticsearch/node/internal/InternalSettingsPreparer.java +++ b/core/src/main/java/org/elasticsearch/node/internal/InternalSettingsPreparer.java @@ -21,7 +21,6 @@ package org.elasticsearch.node.internal; import com.google.common.base.Charsets; import com.google.common.collect.Sets; -import com.google.common.collect.UnmodifiableIterator; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.common.Booleans; import org.elasticsearch.common.Strings; @@ -38,14 +37,11 @@ import java.io.InputStreamReader; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ThreadLocalRandom; -import static org.elasticsearch.common.Strings.cleanPath; import static org.elasticsearch.common.settings.Settings.settingsBuilder; /**