[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/system/conf/global-system.xml idp-core/src/mai...

noreply at shibboleth.net noreply at shibboleth.net
Tue Jun 24 11:53:13 EDT 2014


Author: tzeller
Date: Tue Jun 24 11:53:12 2014
New Revision: 6162

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6162&view=rev
Log:
Only set the 'idp.home' property from the Spring application context on the Logback logger context.

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

Modified: trunk/idp-conf/src/main/resources/system/conf/global-system.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/conf/global-system.xml?rev=6162&r1=6161&r2=6162&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/conf/global-system.xml (original)
+++ trunk/idp-conf/src/main/resources/system/conf/global-system.xml Tue Jun 24 11:53:12 2014
@@ -44,7 +44,6 @@
     
     <bean id="shibboleth.LogbackLogging" class="net.shibboleth.idp.log.LogbackLoggingService" init-method="start" destroy-method="stop"
           p:loggingConfiguration="%{idp.home}/conf/logback.xml"
-          p:properties="%{idp.home}/conf/idp.properties"
           p:reloadCheckDelay="%{idp.service.logging.checkInterval:PT5M}"
           p:reloadTaskTimer-ref="shibboleth.TaskTimer"
           p:failFast="%{idp.service.logging.failFast:true}" />

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=6162&r1=6161&r2=6162&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 Tue Jun 24 11:53:12 2014
@@ -19,15 +19,14 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Properties;
 
 import javax.annotation.Nullable;
 
 import net.shibboleth.idp.service.AbstractReloadableService;
 import net.shibboleth.idp.service.ServiceException;
 import net.shibboleth.idp.service.ServiceableComponent;
+import net.shibboleth.idp.spring.IdPPropertiesApplicationContextInitializer;
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
-import net.shibboleth.utilities.java.support.component.ComponentSupport;
 
 import org.joda.time.DateTime;
 import org.slf4j.LoggerFactory;
@@ -35,7 +34,6 @@
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.PropertiesLoaderUtils;
 
 import ch.qos.logback.classic.LoggerContext;
 import ch.qos.logback.classic.joran.JoranConfigurator;
@@ -63,9 +61,6 @@
     /** Logging configuration resource. */
     private Resource configurationResource;
     
-    /** Properties resource. */
-    @Nullable private Resource propertiesResource;
-
     /** Spring application context. */
     @Nullable private ApplicationContext applicationContext;
 
@@ -89,25 +84,6 @@
         }
 
         configurationResource = configuration;
-    }
-
-    /**
-     * Get the properties resource.
-     * 
-     * @return the properties resource
-     */
-    public Resource getProperties() {
-        return propertiesResource;
-    }
-
-    /**
-     * Set the properties resource.
-     * 
-     * @param properties the properties resource
-     */
-    public void setProperties(@Nullable final Resource properties) {
-        ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-        propertiesResource = properties;
     }
 
     /** {@inheritDoc} */
@@ -196,7 +172,7 @@
     protected void loadLoggingConfiguration(InputStream loggingConfig) throws ServiceException {
         try {
             loggerContext.reset();
-            loadProperties();
+            loadIdPHomeProperty();
             JoranConfigurator configurator = new JoranConfigurator();
             configurator.setContext(loggerContext);
             configurator.doConfigure(loggingConfig);
@@ -207,27 +183,21 @@
     }
 
     /**
-     * Load properties from the properties resource to the active logger context. Include the 'idp.home' property if it
-     * is present in the application context environment.
-     */
-    protected void loadProperties() {
-        if (propertiesResource == null) {
-            return;
-        }
-        
-        statusManager.add(new InfoStatus("Setting supplied properties on LoggerContext", this));
- 
-        if (applicationContext != null && applicationContext.getEnvironment().containsProperty("idp.home")) {
-            loggerContext.putProperty("idp.home", applicationContext.getEnvironment().getProperty("idp.home"));
-        }
-        
-        try {
-            final Properties properties = PropertiesLoaderUtils.loadProperties(propertiesResource);

[... 24 lines stripped ...]


More information about the commits mailing list