[java-identity-provider] branch main updated: IDP-1857 Log the plugins at IdP startup

Rod Widdowson rdw at steadingsoftware.com
Thu Sep 30 12:54:43 UTC 2021


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=81bb6d9af9bbb774803b0550cb84a11a196ef00b

The following commit(s) were added to refs/heads/main by this push:
       new  81bb6d9af IDP-1857 Log the plugins at IdP startup
81bb6d9af is described below

commit 81bb6d9af9bbb774803b0550cb84a11a196ef00b
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Sep 30 13:46:38 2021 +0100

    IDP-1857 Log the plugins at IdP startup
    
    https://shibboleth.atlassian.net/browse/IDP-1857
    
    Fix problems when idpHome is classpath:
---
 .../net/shibboleth/idp/log/LogbackLoggingService.java  | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java b/idp-admin-api/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java
index ee75ab7de..fc65c398a 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java
@@ -19,6 +19,7 @@ package net.shibboleth.idp.log;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.nio.file.Path;
 import java.time.Instant;
 import java.util.List;
 import java.util.ServiceLoader;
@@ -264,7 +265,20 @@ public class LogbackLoggingService extends AbstractReloadableService<Object>
                         idpPlugin.getMajorVersion(), idpPlugin.getPatchVersion());
             }
         }
-        final String idpHome = loggerContext.getProperty(IdPPropertiesApplicationContextInitializer.IDP_HOME_PROPERTY);
+        Path idpHome;
+        final String homeAsString =
+                loggerContext.getProperty(IdPPropertiesApplicationContextInitializer.IDP_HOME_PROPERTY);
+        try {
+            if (homeAsString != null) {
+                idpHome = Path.of(homeAsString);
+            } else {
+                idpHome = null;
+            }
+        } catch (final RuntimeException e) {
+            logger.info("Could not resolve idpHome {} ", homeAsString, e);
+            idpHome = null;
+        }
+
         if (idpHome != null) {
             final ModuleContext context = new ModuleContext(idpHome);
             final List<IdPModule> modules = ServiceLoader.
@@ -281,6 +295,8 @@ public class LogbackLoggingService extends AbstractReloadableService<Object>
                     logger.info("\t\t{}",  module.getName(context));
                 }
             }
+        } else {
+            logger.info("Could not enumerate Modules");
         }
     }
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list