if (bootstrap.node != null) {
logger = Loggers.getLogger(Bootstrap.class, bootstrap.node.settings().get("name"));
}
String errorMessage = buildErrorMessage(stage, e);
if (foreground) {
logger.error(errorMessage);
} else {
System.err.println(errorMessage);
System.err.flush();
}
Loggers.disableConsoleLogging();