From 6a65e7da210412957e043f1cb87cf2b440d8851e Mon Sep 17 00:00:00 2001 From: jeyong Date: Sat, 30 Nov 2024 07:35:45 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20SIGTERM=20=EC=8B=A0=ED=98=B8=EB=A5=BC?= =?UTF-8?q?=20=EC=88=98=EC=8B=A0=ED=95=98=EC=98=80=EB=8B=A4=EB=8A=94=20?= =?UTF-8?q?=EB=A9=94=EC=84=B8=EC=A7=80=EB=A5=BC=20=EC=B6=9C=EB=A0=A5?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/jeyong/handler/ApplicationTerminator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handler/src/main/java/io/jeyong/handler/ApplicationTerminator.java b/handler/src/main/java/io/jeyong/handler/ApplicationTerminator.java index 1dc168a..e33d0bc 100644 --- a/handler/src/main/java/io/jeyong/handler/ApplicationTerminator.java +++ b/handler/src/main/java/io/jeyong/handler/ApplicationTerminator.java @@ -1,9 +1,13 @@ package io.jeyong.handler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sun.misc.SignalHandler; public abstract class ApplicationTerminator { + private static final Logger logger = LoggerFactory.getLogger(ApplicationTerminator.class); + private final String terminationMessagePath; private final String terminationMessage; @@ -14,6 +18,7 @@ protected ApplicationTerminator(final String terminationMessagePath, final Strin public SignalHandler handleTermination() { return signal -> { + logger.info("Received SIGTERM signal. Initiating termination handler."); FileUtils.writeToFile(terminationMessagePath, terminationMessage); System.exit(getExitCode()); };