How does logback remove the annoying info log of dubbomonitor

Time:2021-12-1

Logback removes the info log of dubbomonitor

1. Set Dubbo log from slf4j print

Method 1: settingsjvmparameter


-Ddubbo.application.logger=slf4j

Method 2: code settings


System.setProperty("dubbo.application.logger","slf4j");

2. Logback controls the Dubbo log output level


<logger name="com.alibaba.dubbo" additivity="true" level="ERROR" />

3. Step 1 can be changed to the initial bean setting


@Component  
public class InitService implements InitializingBean {    
    @Override  
    public void afterPropertiesSet() throws Exception {  
     System.setProperty("dubbo.application.logger","slf4j");
    }    
}

Logback close the debug log of zookeeper

Add under this node


<configuration> 
<logger name="org.apache.zookeeper.ClientCnxn" level="info" />  
</configuration> 

nameIs the package name

levelLog level

The above is my personal experience. I hope I can give you a reference, and I hope you can support developpaer.