1、设置Dubbo日志从slf4j打印
方法1:设置jvm参数,-Ddubbo.application.logger=slf4j
方法2:代码设置,System.setProperty("dubbo.application.logger","slf4j");
2、logback控制dubbo日志输出级别
<logger name="com.alibaba.dubbo" additivity="true" level="ERROR" />
3、第1步可以改为初始bean的时候设置
@Component
public class InitService implements InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
System.setProperty("dubbo.application.logger","slf4j");
}
}