Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/3268

Change subject: [NO ISSUE] Add API to override log level on halt
......................................................................

[NO ISSUE] Add API to override log level on halt

Change-Id: Ia5574d5f51c23f6972c5f086938f355a0b55d007
---
M 
hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/68/3268/1

diff --git 
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
 
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
index e2ae73a..52c8f55 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java
@@ -24,6 +24,7 @@
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.lang3.mutable.MutableLong;
+import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
@@ -90,8 +91,13 @@
         exit(status);
     }
 
-    public static synchronized void halt(int status) {
-        LOGGER.fatal("JVM halting with status {}; thread dump at halt: {}", 
status, ThreadDumpUtil.takeDumpString());
+    public static void halt(int status) {
+        halt(status, Level.FATAL);
+    }
+
+    public static synchronized void halt(int status, Level logLevel) {
+        LOGGER.log(logLevel, "JVM halting with status {}; thread dump at halt: 
{}", status,
+                ThreadDumpUtil.takeDumpString());
         // try to give time for the log to be emitted...
         LogManager.shutdown();
         Runtime.getRuntime().halt(status);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/3268
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5574d5f51c23f6972c5f086938f355a0b55d007
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <[email protected]>

Reply via email to