浏览代码

Boostrap: Log startup exception to console if needed and to file as error

Closes #6581
Mark J Greene 11 年之前
父节点
当前提交
d5e813929c
共有 1 个文件被更改,包括 3 次插入6 次删除
  1. 3 6
      src/main/java/org/elasticsearch/bootstrap/Bootstrap.java

+ 3 - 6
src/main/java/org/elasticsearch/bootstrap/Bootstrap.java

@@ -239,13 +239,10 @@ public class Bootstrap {
             if (foreground) {
             if (foreground) {
                 System.err.println(errorMessage);
                 System.err.println(errorMessage);
                 System.err.flush();
                 System.err.flush();
-            } else {
-                logger.error(errorMessage);
-            }
-            Loggers.disableConsoleLogging();
-            if (logger.isDebugEnabled()) {
-                logger.debug("Exception", e);
+                Loggers.disableConsoleLogging();
             }
             }
+            logger.error("Exception", e);
+            
             System.exit(3);
             System.exit(3);
         }
         }
     }
     }