From 180815445c5271dbee42d1983e7724d95b2b38a6 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 27 Oct 2015 13:47:59 +0900 Subject: [PATCH] Fix registration of shutdown handler as a shutdown hook Closes gh-4311 --- .../boot/logging/LoggingApplicationListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java index d2e7760f65..5bee1bab74 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java @@ -337,7 +337,7 @@ public class LoggingApplicationListener implements GenericApplicationListener { Runnable shutdownHandler = loggingSystem.getShutdownHandler(); if (shutdownHandler != null && shutdownHookRegistered.compareAndSet(false, true)) { - Runtime.getRuntime().addShutdownHook(new Thread()); + Runtime.getRuntime().addShutdownHook(new Thread(shutdownHandler)); } } }