spring-cloud-alibaba icon indicating copy to clipboard operation
spring-cloud-alibaba copied to clipboard

nacos配置变更导致logback日志格式变化

Open nian5241 opened this issue 2 years ago • 3 comments

Version:spring-boot.version:2.5.7 spring-cloud.version:2020.0.4 spring-cloud-starter-alibaba-nacos-config:2.2.0.RELEASE

issue detail: 服务启动的之后的日志格式是符合预期的,但是当nacos配置更新的时候会导致我正在运行的服务logback.xml失效,导致日志格式变成了logback默认的。看了下源码发现nacos配置更新的时候会触发服务PropertySourceBootstrapConfiguration的initialize方法,而在这个方法中会重新初始化日志系统,由于我的日志配置是放在applicaiton.properties中的从而导致我自定义的logback.xml失效。想问一下这个是nacos设计之初故意这样设计的还是没考虑到的问题。 56439C29-09FB-41B5-BED7-09297A5D1404

nian5241 avatar Aug 10 '22 07:08 nian5241

Hello, I have reproduced a method of customizing logback through thread context here Can you please reproduce the usage scenario based on this demo?

kaori-seasons avatar Aug 18 '22 13:08 kaori-seasons

This scenario only appears when the nacos configuration changes.and I can share you my demo url.

nian5241 avatar Aug 24 '22 03:08 nian5241

iguration changes.and I can share you my demo url.

Can you share it ?

cevencheng avatar Sep 13 '22 03:09 cevencheng

Long time without response and close first.

steverao avatar Dec 13 '22 10:12 steverao