alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
30.29k stars 12.84k forks source link

1.0.0 Questions about dynamically changing the log level #1089

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

"???????????????

nkorange commented 5 years ago

@lynk-coder Did you try other version of spring-cloud-starter-alibaba-nacos-config? Does the problem still exist?

lynk-coder commented 5 years ago

I've tried the current version, which is still under construction, and the problem persists.

spring-cloud-alibaba-dependencies 0.9.1.BUILD-SNAPSHOT

nkorange commented 5 years ago

@lynk-coder Can you paste or upload a minimum runnable source package to reproduce this problem?

lynk-coder commented 5 years ago

Ok, let me try.

lynk-coder commented 5 years ago

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