From b4ffad5c2cc8363d089876e20cc3baecce6658f8 Mon Sep 17 00:00:00 2001 From: JFronny Date: Thu, 14 Mar 2024 15:36:26 +0100 Subject: [PATCH] fix(logger): catch exception during configuration --- .../gitlab/jfronny/commons/logger/HotswapLoggerFinder.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/commons-logger/src/main/java/io/gitlab/jfronny/commons/logger/HotswapLoggerFinder.java b/commons-logger/src/main/java/io/gitlab/jfronny/commons/logger/HotswapLoggerFinder.java index 043d73f..b832b10 100644 --- a/commons-logger/src/main/java/io/gitlab/jfronny/commons/logger/HotswapLoggerFinder.java +++ b/commons-logger/src/main/java/io/gitlab/jfronny/commons/logger/HotswapLoggerFinder.java @@ -57,7 +57,12 @@ public class HotswapLoggerFinder extends LeveledLoggerFinder { } static { - ServiceLoader.load(LoggerConfiguration.class).forEach(LoggerConfiguration::configure); + try { + ServiceLoader.load(LoggerConfiguration.class).forEach(LoggerConfiguration::configure); + } catch (Throwable t) { + System.err.println("Could not initialize LoggerConfiguration"); + t.printStackTrace(); + } } public HotswapLoggerFinder() {