liubao68 commented on a change in pull request #2644:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/2644#discussion_r755788606
##########
File path:
core/src/main/java/org/apache/servicecomb/core/ConfigurationSpringInitializer.java
##########
@@ -231,15 +232,21 @@ private static void addMappingToSpring(Environment
environment) {
private void addDynamicConfigurationToSpring(Environment environment,
ConfigCenterConfigurationSource configCenterConfigurationSource) {
- if (environment instanceof ConfigurableEnvironment) {
- ConfigurableEnvironment ce = (ConfigurableEnvironment) environment;
- if (configCenterConfigurationSource != null) {
- try {
- ce.getPropertySources()
- .addFirst(new MapPropertySource("dynamic-source", dynamicData));
- } catch (Exception e) {
- LOGGER.warn("set up spring property source failed. msg: {}",
e.getMessage());
- }
+ if (!(environment instanceof ConfigurableEnvironment)) {
+ return;
+ }
+ ConfigurableEnvironment ce = (ConfigurableEnvironment) environment;
+ if (configCenterConfigurationSource == null) {
+ return;
+ }
+ try {
+ ce.getPropertySources().addFirst(new MapPropertySource("dynamic-source",
dynamicData));
+ } catch (Exception e) {
+ if
(DynamicPropertyFactory.getInstance().getBooleanProperty(Const.PRINT_SENSITIVE_ERROR_MESSAGE,
+ false).get()) {
+ LOGGER.warn("set up spring property source failed. msg", e);
Review comment:
LOGGER.warn("set up spring property source failed. ", e);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]