log4j:WARN No appenders could be found for logger (org.apache.dubbo.common.logger.LoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
出现这样的警告, 就是因为相关的 jar 包中依赖有 log4j
1. 如果不配置 dubbo.application.logger 的话, Dubbo默认是使用 slf4j
通过dubbo类org.apache.dubbo.common.logger.LoggerFactory, 就可以看出来
2. 打开 pom.xml 文件, 切换到 Dependency Hierarchy 标签页, 然后可以Filter检索, 哪些 jar 包依赖 log4j, 然后在pom.xml文件中 exclusions 相应的
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-serialization-fst</artifactId>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
来源:oschina
链接:https://my.oschina.net/zdtdtel/blog/4704892