config(gateway): 配置中心和日志配置外置到Nacos

- 添加Nacos配置中心依赖并启用配置导入功能
- 将网关日志配置外置到Nacos gateway-server.yaml文件
- 将业务模块日志文件路径配置外置到Nacos rdms-common.yaml
- 在pom.xml中设置addResources为false避免占位符不被替换
- 添加logback-spring.xml配置文件用于日志格式化和滚动策略
- 优化日志配置管理方式,实现按环境统一配置
This commit is contained in:
2026-06-22 14:10:29 +08:00
parent d2224e0cfc
commit b4f6eab64c
6 changed files with 70 additions and 10 deletions

View File

@@ -54,6 +54,12 @@
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- Config 配置中心相关 -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 工具类相关 -->
<dependency>
<groupId>com.google.guava</groupId>
@@ -77,6 +83,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<!-- 必须为 falseaddResources=true 会让 spring-boot:run 直接挂载源 resources 目录、
跳过资源过滤,导致 application.yaml 里的 @nacos.xxx@ 占位符不被替换。 -->
<addResources>false</addResources>
</configuration>
<executions>
<execution>
<goals>