Manually call Log4J shutdown hook after we complete our shutdown
@@ -94,7 +94,11 @@ public class Kernel {
context.put(Executor.class, executorService);
context.put(ExecutorService.class, executorService);
context.put(ThreadPoolExecutor.class, ses);
- Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown));
+ Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+ shutdown();
+ // Shutdown Log4j because we disabled it's shutdown hook
+ org.apache.logging.log4j.LogManager.shutdown();
+ }));
kernelCommandLine = new KernelCommandLine(this);
kernelLifecycle = new KernelLifecycle(this, kernelCommandLine);
context.put(KernelCommandLine.class, kernelCommandLine);
