diff --git a/assembly/assembly.xml b/assembly/assembly.xml index f41f1c6..6813753 100644 --- a/assembly/assembly.xml +++ b/assembly/assembly.xml @@ -15,11 +15,20 @@ stop.sh restart.sh status.sh - env.properties 0755 + + + ${project.basedir}/../scripts + conf + + env.properties + + 0644 + + src/main/resources diff --git a/fund-cust/src/main/resources/application.yml b/fund-cust/src/main/resources/application.yml index 732d114..3bf9153 100644 --- a/fund-cust/src/main/resources/application.yml +++ b/fund-cust/src/main/resources/application.yml @@ -41,12 +41,6 @@ mybatis-plus: logic-delete-value: 1 logic-not-delete-value: 0 -logging: - level: - com.fundplatform.cust: DEBUG - pattern: - console: "${LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n}" - # 多租户路由配置 tenant: routing: diff --git a/fund-cust/src/main/resources/logback-spring.xml b/fund-cust/src/main/resources/logback-spring.xml index 28045b2..3184538 100644 --- a/fund-cust/src/main/resources/logback-spring.xml +++ b/fund-cust/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/fund-exp/src/main/resources/application.yml b/fund-exp/src/main/resources/application.yml index bf44010..7fda0fe 100644 --- a/fund-exp/src/main/resources/application.yml +++ b/fund-exp/src/main/resources/application.yml @@ -40,12 +40,6 @@ mybatis-plus: logic-delete-value: 1 logic-not-delete-value: 0 -logging: - level: - com.fundplatform.exp: DEBUG - pattern: - console: "${LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n}" - # 多租户路由配置 tenant: routing: diff --git a/fund-exp/src/main/resources/logback-spring.xml b/fund-exp/src/main/resources/logback-spring.xml index 2968402..3184538 100644 --- a/fund-exp/src/main/resources/logback-spring.xml +++ b/fund-exp/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/fund-file/src/main/resources/application.yml b/fund-file/src/main/resources/application.yml index 1a80450..31cea38 100644 --- a/fund-file/src/main/resources/application.yml +++ b/fund-file/src/main/resources/application.yml @@ -42,12 +42,6 @@ file: path: ${FILE_STORAGE_PATH:./uploads} max-size: ${FILE_STORAGE_MAX_BYTES:52428800} -logging: - level: - com.fundplatform.file: DEBUG - pattern: - console: "${LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n}" - # 共享服务,禁用租户路由 tenant: routing: diff --git a/fund-file/src/main/resources/logback-spring.xml b/fund-file/src/main/resources/logback-spring.xml index 5343902..3184538 100644 --- a/fund-file/src/main/resources/logback-spring.xml +++ b/fund-file/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/fund-gateway/src/main/resources/application.yml b/fund-gateway/src/main/resources/application.yml index 71f4ce2..332b3f5 100644 --- a/fund-gateway/src/main/resources/application.yml +++ b/fund-gateway/src/main/resources/application.yml @@ -123,11 +123,6 @@ spring: filters: - StripPrefix=1 -logging: - level: - org.springframework.cloud.gateway: DEBUG - com.fundplatform.common.loadbalancer: DEBUG - # 多租户路由配置 tenant: routing: diff --git a/fund-gateway/src/main/resources/logback-spring.xml b/fund-gateway/src/main/resources/logback-spring.xml index d0a03ce..3184538 100644 --- a/fund-gateway/src/main/resources/logback-spring.xml +++ b/fund-gateway/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -74,7 +78,7 @@ - + ${LOG_PATH}/${APP_NAME}/aop.log @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/fund-proj/src/main/resources/application.yml b/fund-proj/src/main/resources/application.yml index aa5caab..19432a7 100644 --- a/fund-proj/src/main/resources/application.yml +++ b/fund-proj/src/main/resources/application.yml @@ -40,12 +40,6 @@ mybatis-plus: logic-delete-value: 1 logic-not-delete-value: 0 -logging: - level: - com.fundplatform.proj: DEBUG - pattern: - console: "${LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n}" - # 多租户路由配置 tenant: routing: diff --git a/fund-proj/src/main/resources/logback-spring.xml b/fund-proj/src/main/resources/logback-spring.xml index 8e2ceaa..3184538 100644 --- a/fund-proj/src/main/resources/logback-spring.xml +++ b/fund-proj/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/fund-receipt/src/main/resources/application.yml b/fund-receipt/src/main/resources/application.yml index 1d8ddd4..fcaa899 100644 --- a/fund-receipt/src/main/resources/application.yml +++ b/fund-receipt/src/main/resources/application.yml @@ -40,12 +40,6 @@ mybatis-plus: logic-delete-value: 1 logic-not-delete-value: 0 -logging: - level: - com.fundplatform.receipt: DEBUG - pattern: - console: "${LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n}" - # 多租户路由配置 tenant: routing: diff --git a/fund-receipt/src/main/resources/logback-spring.xml b/fund-receipt/src/main/resources/logback-spring.xml index 070da2c..3184538 100644 --- a/fund-receipt/src/main/resources/logback-spring.xml +++ b/fund-receipt/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/fund-report/src/main/resources/application.yml b/fund-report/src/main/resources/application.yml index 0f90e89..c4abbb4 100644 --- a/fund-report/src/main/resources/application.yml +++ b/fund-report/src/main/resources/application.yml @@ -21,12 +21,6 @@ spring: password: ${DB_PASSWORD:zjf@123456} driver-class-name: com.mysql.cj.jdbc.Driver -logging: - level: - com.fundplatform.report: DEBUG - pattern: - console: "${LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n}" - # 共享服务,禁用租户路由 tenant: routing: diff --git a/fund-report/src/main/resources/logback-spring.xml b/fund-report/src/main/resources/logback-spring.xml index c1b21a6..3184538 100644 --- a/fund-report/src/main/resources/logback-spring.xml +++ b/fund-report/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/fund-req/src/main/resources/application.yml b/fund-req/src/main/resources/application.yml index fbef340..efbcc68 100644 --- a/fund-req/src/main/resources/application.yml +++ b/fund-req/src/main/resources/application.yml @@ -40,12 +40,6 @@ mybatis-plus: logic-delete-value: 1 logic-not-delete-value: 0 -logging: - level: - com.fundplatform.req: DEBUG - pattern: - console: "${LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n}" - # 多租户路由配置 tenant: routing: diff --git a/fund-req/src/main/resources/logback-spring.xml b/fund-req/src/main/resources/logback-spring.xml index 4c5793f..3184538 100644 --- a/fund-req/src/main/resources/logback-spring.xml +++ b/fund-req/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/fund-sys/src/main/resources/application.yml b/fund-sys/src/main/resources/application.yml index b6283b8..e3debfd 100644 --- a/fund-sys/src/main/resources/application.yml +++ b/fund-sys/src/main/resources/application.yml @@ -70,12 +70,6 @@ mybatis-plus: tenant: enabled: false # 启用后自动为 SQL 添加 tenant_id 条件 -logging: - level: - com.fundplatform.sys: DEBUG - pattern: - console: "${LOG_PATTERN:%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n}" - # 多租户路由配置 tenant: routing: diff --git a/fund-sys/src/main/resources/logback-spring.xml b/fund-sys/src/main/resources/logback-spring.xml index a5bc6ee..3184538 100644 --- a/fund-sys/src/main/resources/logback-spring.xml +++ b/fund-sys/src/main/resources/logback-spring.xml @@ -1,14 +1,18 @@ - - - + + + + + + - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -17,7 +21,7 @@ ${LOG_PATH}/${APP_NAME}/info.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -38,7 +42,7 @@ ${LOG_PATH}/${APP_NAME}/error.log - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n + ${LOG_PATTERN} UTF-8 @@ -95,16 +99,23 @@ + + + + + + + - + - + @@ -113,7 +124,7 @@ - + diff --git a/scripts/env.properties b/scripts/env.properties index 43d93c7..b1e8e82 100644 --- a/scripts/env.properties +++ b/scripts/env.properties @@ -62,9 +62,16 @@ FILE_STORAGE_PATH=./uploads FILE_STORAGE_MAX_BYTES=52428800 # -------------------------------------------- -# 日志配置 +# 日志配置(由logback-spring.xml统一管理) # -------------------------------------------- -LOG_PATTERN=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n +# 日志文件路径 +LOG_PATH=/datacfs/applogs +# 根日志级别 +LOG_LEVEL_ROOT=INFO +# 应用包日志级别 +LOG_LEVEL_APP=DEBUG +# 日志格式 +LOG_PATTERN=%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId:-}][%X{spanId:-}] %-5level %logger{50} - %msg%n # -------------------------------------------- # 多租户路由配置 diff --git a/scripts/start.sh b/scripts/start.sh index fab8df0..e0a6343 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -24,8 +24,11 @@ fi # JVM参数(可通过环境变量覆盖) JAVA_OPTS="${JAVA_OPTS:--Xms256m -Xmx512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200}" -# 日志参数 +# 日志参数(从env.properties读取或使用默认值) LOG_OPTS="-Dlogging.file.path=${LOG_HOME} -DAPP_NAME=${APP_NAME}" +LOG_OPTS="$LOG_OPTS -Dlogging.level.root=${LOG_LEVEL_ROOT:-INFO}" +LOG_OPTS="$LOG_OPTS -Dlogging.level.app=${LOG_LEVEL_APP:-DEBUG}" +LOG_OPTS="$LOG_OPTS -Dlogging.pattern.console=${LOG_PATTERN}" # 配置文件路径 CONFIG_OPTS="--spring.config.location=${APP_HOME}/conf/application.yml"