Michael Blow has submitted this change and it was merged. 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 Reviewed-on: https://asterix-gerrit.ics.uci.edu/3268 Sonar-Qube: Jenkins <[email protected]> Reviewed-by: Murtadha Hubail <[email protected]> Tested-by: Michael Blow <[email protected]> --- M hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/ExitUtil.java 1 file changed, 8 insertions(+), 2 deletions(-) Approvals: Jenkins: No violations found Michael Blow: Verified Murtadha Hubail: Looks good to me, approved 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: merged Gerrit-Change-Id: Ia5574d5f51c23f6972c5f086938f355a0b55d007 Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Michael Blow <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Murtadha Hubail <[email protected]>
