Revision 9990
Added by Jing Tao over 7 years ago
ApplicationController.java | ||
---|---|---|
26 | 26 |
|
27 | 27 |
import org.apache.commons.configuration.ConfigurationException; |
28 | 28 |
import org.apache.commons.logging.Log; |
29 |
import org.apache.log4j.PropertyConfigurator; |
|
29 | 30 |
import org.apache.commons.logging.LogFactory; |
30 | 31 |
import org.apache.solr.client.solrj.SolrServer; |
31 | 32 |
import org.dataone.configuration.Settings; |
... | ... | |
133 | 134 |
} |
134 | 135 |
if(foundProperty) { |
135 | 136 |
period = Settings.getConfiguration().getLong("index.regenerate.interval"); |
137 |
String log4jPropFile = Settings.getConfiguration().getString("application.deployDir") + "/" + |
|
138 |
Settings.getConfiguration().getString("index.context") + "/WEB-INF/classes/log4j.properties"; |
|
139 |
log.info("ApplicationController.initializeSharedConfiguration - the log4j.properties file is "+log4jPropFile); |
|
140 |
//When the log4j.properties is changed, it will reload the properties without restart tomcat |
|
141 |
PropertyConfigurator.configureAndWatch(log4jPropFile); |
|
136 | 142 |
} |
137 | 143 |
|
138 | 144 |
} |
Also available in: Unified diff
Add the method PropertyConfigurator.configureAndWatch to monitor the change on log4j.properties file.