Merge pull request #16834 from rjernst/dont_hide_log4j_exceptions

Core: Remove log4j exception hiding
This commit is contained in:
Ryan Ernst 2016-02-26 15:01:56 -08:00
commit ae87a635c1
1 changed files with 1 additions and 16 deletions

View File

@ -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) {