diff --git a/yupiik-logging-jul/src/main/java/io/yupiik/logging/jul/YupiikLoggers.java b/yupiik-logging-jul/src/main/java/io/yupiik/logging/jul/YupiikLoggers.java index a4846ac..e34f28a 100644 --- a/yupiik-logging-jul/src/main/java/io/yupiik/logging/jul/YupiikLoggers.java +++ b/yupiik-logging-jul/src/main/java/io/yupiik/logging/jul/YupiikLoggers.java @@ -139,7 +139,11 @@ public synchronized void readConfiguration() throws IOException, SecurityExcepti } }), getClass().getName() + "-shutdown"); state.shutdownHook = hook; - Runtime.getRuntime().addShutdownHook(hook); + try { + Runtime.getRuntime().addShutdownHook(hook); + } catch (final RuntimeException re) { + // no-op, shutting down + } final var location = getProperty("java.util.logging.config.file"); if (location != null) { final var path = Paths.get(location);