[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/conf/logback.xml idp-core/src/main/java/net/sh...

noreply at shibboleth.net noreply at shibboleth.net
Wed Jan 28 14:27:53 EST 2015


Author: tzeller
Date: Wed Jan 28 14:27:52 2015
New Revision: 7288

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7288&view=rev
Log:
IDP-569 Log Java version and vendor to INFO and standard system properties to DEBUG.

Modified:
    trunk/idp-conf/src/main/resources/conf/logback.xml
    trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java

Modified: trunk/idp-conf/src/main/resources/conf/logback.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/conf/logback.xml?rev=7288&r1=7287&r2=7288&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/conf/logback.xml (original)
+++ trunk/idp-conf/src/main/resources/conf/logback.xml Wed Jan 28 14:27:52 2015
@@ -18,6 +18,11 @@
     <!-- Logs unencrypted SAML at DEBUG level -->
     <!--
     <logger name="SAML_PRE_ENCRYPTION" level="DEBUG" />
+    -->
+
+    <!-- Logs standard system properties during startup at DEBUG level -->
+    <!-- 
+    <logger name="STARTUP_PROPERTIES" level="DEBUG" />
     -->
 
     <!-- Especially chatty. -->

Modified: trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java?rev=7288&r1=7287&r2=7288&view=diff
==============================================================================
--- trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java (original)
+++ trunk/idp-core/src/main/java/net/shibboleth/idp/log/LogbackLoggingService.java Wed Jan 28 14:27:52 2015
@@ -34,6 +34,7 @@
 import net.shibboleth.utilities.java.support.service.ServiceableComponent;
 
 import org.joda.time.DateTime;
+import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
@@ -47,6 +48,7 @@
 import ch.qos.logback.core.status.InfoStatus;
 import ch.qos.logback.core.status.StatusManager;
 
+import com.google.common.base.StandardSystemProperty;
 import com.google.common.io.Closeables;
 
 /**
@@ -56,6 +58,9 @@
 public class LogbackLoggingService extends AbstractReloadableService<Object>
         implements LoggingService, ApplicationContextAware {
 
+    /** Name of logger used to log standard system properties at startup.*/
+    private static final String STARTUP_PROPERTIES_LOGGER = "STARTUP_PROPERTIES";
+    
     /** Logback logger context. */
     private LoggerContext loggerContext;
 
@@ -203,8 +208,7 @@
             configurator.setContext(loggerContext);
             configurator.doConfigure(loggingConfig);
             loggerContext.start();
-            LoggerFactory.getLogger(LogbackLoggingService.class).info("Shibboleth IdP Version {}",
-                    Version.getVersion());
+            logImplementationDetails();
         } catch (final JoranException e) {
             throw new ServiceException(e);
         }
@@ -228,5 +232,25 @@
             }
         }
     }
-    
+
+    /**
+     * Log the IdP version and Java version and vendor at INFO level.
+     * 
+     * Log system properties defined by {@link StandardSystemProperty} to the
+     * {@link LogbackLoggingService#STARTUP_PROPERTIES_LOGGER} logger at DEBUG level if enabled.
+     */
+    protected void logImplementationDetails() {
+        final Logger logger = LoggerFactory.getLogger(LogbackLoggingService.class);
+        logger.info("Shibboleth IdP Version {}", Version.getVersion());
+        logger.info("Java Version='{}' Vendor='{}'", StandardSystemProperty.JAVA_VERSION.value(),
+                StandardSystemProperty.JAVA_VENDOR.value());
+
+        final Logger startupPropertiesLogger = LoggerFactory.getLogger(STARTUP_PROPERTIES_LOGGER);
+        if (startupPropertiesLogger.isDebugEnabled()) {
+            for (StandardSystemProperty standardSystemProperty : StandardSystemProperty.values()) {
+                startupPropertiesLogger.debug("{}", standardSystemProperty);
+            }
+        }
+    }
+
 }



More information about the commits mailing list