Skip to content

Commit 21ff216

Browse files
committed
Do not log with warning if no extension found
which introduced by apache#1837 eg: ``` ApplicationConfig applicationConfig = new ApplicationConfig(); applicationConfig.setName("demo-app"); applicationConfig.setLogger("slf4j"); ```
1 parent 9a9bf2a commit 21ff216

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/extension/SpringExtensionFactory.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ public <T> T getExtension(Class<T> type, String name) {
8383
}
8484
}
8585

86-
logger.warn("No spring extension (bean) named:" + name + ", try to find an extension (bean) of type " + type.getName());
86+
if (logger.isDebugEnabled()) {
87+
logger.debug("No spring extension (bean) named:" + name + ", try to find an extension (bean) of type " + type.getName());
88+
}
8789

8890
if (Object.class == type) {
8991
return null;
@@ -101,7 +103,9 @@ public <T> T getExtension(Class<T> type, String name) {
101103
}
102104
}
103105

104-
logger.warn("No spring extension (bean) named:" + name + ", type:" + type.getName() + " found, stop get bean.");
106+
if (logger.isDebugEnabled()) {
107+
logger.debug("No spring extension (bean) named:" + name + ", type:" + type.getName() + " found, stop get bean.");
108+
}
105109

106110
return null;
107111
}

0 commit comments

Comments
 (0)