Add logger.isInfoEnabled check before logger.info

Closes gh-24667
This commit is contained in:
Qimiao Chen
2020-03-10 21:41:20 +08:00
committed by GitHub
parent 018ba92214
commit b92515bdee

View File

@@ -254,7 +254,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
return getSingletonInstance();
}
else {
if (this.targetName == null) {
if (this.targetName == null && logger.isInfoEnabled()) {
logger.info("Using non-singleton proxies with singleton targets is often undesirable. " +
"Enable prototype proxies by setting the 'targetName' property.");
}