alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
27.83k stars 8.31k forks source link

0.9.1.BUILD-SNAPSHOT Questions about dynamically changing the log level #585

Closed lynk-coder closed 5 years ago

lynk-coder commented 5 years ago

I found that once I configured spring-cloud-starter-alibaba-nacos-config, the dynamic level of my log will not take effect. I wonder if this is a BUG, or how do I need to adjust it?

springboot 2.x+springcloud+nacos+logback

LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); loggerContext.getLogger("org.mybatis.log.sql").setLevel(Level.valueOf(Config.IS_BEBUG?"debug":"warn"));

Dynamic failure

lynk-coder commented 5 years ago

Resolved, I initialize the dynamic switch log level code after the Config configuration can be.