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.41k stars 12.87k forks source link

spring-boot3.0.13读取nacos配置的logback配置失败 #11673

Closed lucky845 closed 9 months ago

lucky845 commented 10 months ago

项目从2.7.13升级到3.0.13后,org.springframework.boot.logging.logback.LogbackLoggingSystem类中的configureByResourceUrl方法判断的是path是否以.xml结尾,使用logging.config=http://${spring.cloud.nacos.config.server-addr}/nacos/v1/cs/configs?group=DEFAULT_GROUP&tenant=${spring.cloud.nacos.config.namespace}&dataId=logback-common.xml方式的配置无法使用了,请问有其他方式配置吗

image
YuShiwen commented 10 months ago

@i will solve it@

YuShiwen commented 10 months ago

项目从2.7.13升级到3.0.13后,org.springframework.boot.logging.logback.LogbackLoggingSystem类中的configureByResourceUrl方法判断或者路径是否以.xml结尾,使用logging.config=http://${spring .cloud.nacos.config.server-addr}/nacos/v1/cs/configs?group=DEFAULT_GROUP&tenant=${spring.cloud.nacos.config.namespace}&dataId=logback-common.xml方式的配置无法使用了,请问还有其他方式配置吗 图像

麻烦提供一下pom.xml文件中nacos的依赖; 看下是哪种依赖引入,版本号也麻烦提供一下哈

<dependency>
    <groupId>com.alibaba.nacos</groupId>
    <artifactId>nacos-client</artifactId>
    <version>xxx</version>
</dependency>

<dependency>
    <groupId>com.alibaba.boot</groupId>
    <artifactId>nacos-config-spring-boot-starter</artifactId>
    <version>xxx</version>
</dependency>

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
    <version>xxx</version>
</dependency>
lucky845 commented 10 months ago

项目从2.7.13升级到3.0.13后,org.springframework.boot.logging.logback.LogbackLoggingSystem类中的configureByResourceUrl方法判断或者路径是否以.xml结尾,使用logging.config=http://${spring .cloud.nacos.config.server-addr}/nacos/v1/cs/configs?group=DEFAULT_GROUP&tenant=${spring.cloud.nacos.config.namespace}&dataId=logback-common.xml方式的配置无法使用了,请问还有其他方式配置吗 图像

麻烦提供一下pom.xml文件中nacos的依赖; 看下是哪种依赖引入,版本号也麻烦提供一下哈

<dependency>
    <groupId>com.alibaba.nacos</groupId>
    <artifactId>nacos-client</artifactId>
    <version>xxx</version>
</dependency>

<dependency>
    <groupId>com.alibaba.boot</groupId>
    <artifactId>nacos-config-spring-boot-starter</artifactId>
    <version>xxx</version>
</dependency>

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
    <version>xxx</version>
</dependency>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
            <version>2022.0.0.0</version>
        </dependency>

        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
            <version>2022.0.0.0</version>
        </dependency>
KomachiSion commented 9 months ago

This Issue has more than one month no response. But I see the the usage is spring cloud alibaba. Should we move this issue to SCA community to find answer. The configuration in nacos is only push to app(SCA), but how to use is not nacos' feature but SCA.