Moving system property setting to before it can be used

This commit is contained in:
Chris Earle 2015-09-18 13:22:33 -04:00
parent 09dcd88410
commit 764051b4e3
1 changed files with 4 additions and 1 deletions

View File

@ -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")));