From 764051b4e33eb95b31dcd706b34d2fff29cbeb34 Mon Sep 17 00:00:00 2001 From: Chris Earle Date: Fri, 18 Sep 2015 13:22:33 -0400 Subject: [PATCH] Moving system property setting to before it can be used --- .../src/main/java/org/elasticsearch/bootstrap/Bootstrap.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java b/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java index 86e9c2f9114..e5397bbe7e1 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java @@ -217,7 +217,11 @@ final class Bootstrap { * This method is invoked by {@link Elasticsearch#main(String[])} * to startup elasticsearch. */ + @SuppressForbidden(reason = "System#out") static void init(String[] args) throws Throwable { + // Set the system property before anything has a chance to trigger its use + System.setProperty("es.logger.prefix", ""); + BootstrapCLIParser bootstrapCLIParser = new BootstrapCLIParser(); CliTool.ExitStatus status = bootstrapCLIParser.execute(args); @@ -225,7 +229,6 @@ final class Bootstrap { System.exit(status.status()); } - System.setProperty("es.logger.prefix", ""); INSTANCE = new Bootstrap(); boolean foreground = !"false".equals(System.getProperty("es.foreground", System.getProperty("es-foreground")));