diff --git a/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java b/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java index ec4e5ba2421..7ba959415c0 100644 --- a/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java +++ b/core/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java @@ -193,21 +193,6 @@ final class Bootstrap { node = new Node(nodeSettings); } - @SuppressForbidden(reason = "Exception#printStackTrace()") - private static void setupLogging(Settings settings) { - try { - Class.forName("org.apache.log4j.Logger"); - LogConfigurator.configure(settings, true); - } catch (ClassNotFoundException e) { - // no log4j - } catch (NoClassDefFoundError e) { - // no log4j - } catch (Exception e) { - sysError("Failed to configure logging...", false); - e.printStackTrace(); - } - } - private static Environment initialSettings(boolean foreground) { Terminal terminal = foreground ? Terminal.DEFAULT : null; return InternalSettingsPreparer.prepareEnvironment(EMPTY_SETTINGS, terminal); @@ -254,7 +239,7 @@ final class Bootstrap { Environment environment = initialSettings(foreground); Settings settings = environment.settings(); - setupLogging(settings); + LogConfigurator.configure(settings, true); checkForCustomConfFile(); if (environment.pidFile() != null) {