From 731025c3d74d7ca4183c5b9fbf9421fe77f7b290 Mon Sep 17 00:00:00 2001 From: GedMarc Date: Tue, 27 Aug 2024 16:17:01 +0200 Subject: [PATCH] Make websocket registration singular --- .../com/guicedee/guicedinjection/GuiceContext.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/guicedee/guicedinjection/GuiceContext.java b/src/main/java/com/guicedee/guicedinjection/GuiceContext.java index 9383b09..431e061 100644 --- a/src/main/java/com/guicedee/guicedinjection/GuiceContext.java +++ b/src/main/java/com/guicedee/guicedinjection/GuiceContext.java @@ -102,8 +102,8 @@ private GuiceContext() { try { - // String cn = "org.apache.logging.log4j.jul.LogManager"; - // System.setProperty("java.util.logging.manager", cn); + // String cn = "org.apache.logging.log4j.jul.LogManager"; + // System.setProperty("java.util.logging.manager", cn); ConfigurationBuilder builder = ConfigurationBuilderFactory.newConfigurationBuilder(); @@ -115,14 +115,13 @@ private GuiceContext() AppenderComponentBuilder appenderBuilder = builder.newAppender("Stdout", "CONSOLE") .addAttribute("target", ConsoleAppender.Target.SYSTEM_ERR) - //.addAttribute("additivity", "true") + //.addAttribute("additivity", "true") ; appenderBuilder.add(builder.newLayout("PatternLayout"). addAttribute("pattern", "%d{ABSOLUTE} %-5level: %msg%n")); builder.add(appenderBuilder); - RootLoggerComponentBuilder rootLogger = builder.newRootLogger(org.apache.logging.log4j.Level.DEBUG); ServiceLoader log4JConfigurators = ServiceLoader.load(Log4JConfigurator.class); for (Log4JConfigurator log4jConfigurator : log4JConfigurators) @@ -852,6 +851,12 @@ private void loadPostStartups() if (!futures.isEmpty()) { CompletableFuture.allOf(futures.toArray(new CompletableFuture[]{})) + .whenCompleteAsync((response, errors) -> { + if (errors != null) + { + log.log(Level.SEVERE, "Errors loading in post startup groups - " + value, errors); + } + }) .join(); if (ex != null) {