diff --git a/fund-cust/src/main/resources/logback-spring.xml b/fund-cust/src/main/resources/logback-spring.xml index 475822e..05c9048 100644 --- a/fund-cust/src/main/resources/logback-spring.xml +++ b/fund-cust/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/fund-exp/src/main/resources/logback-spring.xml b/fund-exp/src/main/resources/logback-spring.xml index 375be32..adccffa 100644 --- a/fund-exp/src/main/resources/logback-spring.xml +++ b/fund-exp/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/fund-file/src/main/resources/logback-spring.xml b/fund-file/src/main/resources/logback-spring.xml index c439ff9..5ee087f 100644 --- a/fund-file/src/main/resources/logback-spring.xml +++ b/fund-file/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/fund-gateway/src/main/resources/logback-spring.xml b/fund-gateway/src/main/resources/logback-spring.xml index 77ef818..acf0b31 100644 --- a/fund-gateway/src/main/resources/logback-spring.xml +++ b/fund-gateway/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/fund-proj/src/main/resources/logback-spring.xml b/fund-proj/src/main/resources/logback-spring.xml index a8abb2c..cc6306c 100644 --- a/fund-proj/src/main/resources/logback-spring.xml +++ b/fund-proj/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/fund-receipt/src/main/resources/logback-spring.xml b/fund-receipt/src/main/resources/logback-spring.xml index 76e7288..081b86c 100644 --- a/fund-receipt/src/main/resources/logback-spring.xml +++ b/fund-receipt/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/fund-report/src/main/resources/logback-spring.xml b/fund-report/src/main/resources/logback-spring.xml index 4af285e..50711c5 100644 --- a/fund-report/src/main/resources/logback-spring.xml +++ b/fund-report/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/fund-req/src/main/resources/logback-spring.xml b/fund-req/src/main/resources/logback-spring.xml index abcb6b5..f2d0d13 100644 --- a/fund-req/src/main/resources/logback-spring.xml +++ b/fund-req/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/fund-sys/src/main/resources/logback-spring.xml b/fund-sys/src/main/resources/logback-spring.xml index 1bde0b7..c25d449 100644 --- a/fund-sys/src/main/resources/logback-spring.xml +++ b/fund-sys/src/main/resources/logback-spring.xml @@ -2,11 +2,12 @@ - + + - + diff --git a/scripts/start.sh b/scripts/start.sh index c0a8626..59aed62 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -59,8 +59,9 @@ PID_FILE="${APP_HOME}/${INSTANCE_NAME}.pid" # JVM参数(可通过环境变量覆盖) JAVA_OPTS="${JAVA_OPTS:--Xms256m -Xmx512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200}" -# 日志目录参数(其他日志配置在application.yml/logback-spring.xml中) +# 日志目录参数(使用INSTANCE_NAME区分实例) LOG_OPTS="-Dlogging.file.path=${LOG_HOME}" +LOG_OPTS="$LOG_OPTS -Dapp.instance.name=${INSTANCE_NAME}" # 多租户参数 TENANT_OPTS="" @@ -77,8 +78,8 @@ if [ -f "$PID_FILE" ]; then fi fi -# 创建日志目录 -mkdir -p ${LOG_HOME} +# 创建日志目录(使用INSTANCE_NAME区分实例) +mkdir -p ${LOG_HOME}/${INSTANCE_NAME} # 启动服务 echo "Starting ${INSTANCE_NAME}..." @@ -94,7 +95,7 @@ if [ -n "${TENANT_ID}" ]; then fi # 启动命令:java -cp lib/*:conf MainClass -nohup java $JAVA_OPTS $LOG_OPTS $TENANT_OPTS -cp "$CLASSPATH" $MAIN_CLASS > /dev/null 2>&1 & +nohup java $JAVA_OPTS $LOG_OPTS $TENANT_OPTS -cp "$CLASSPATH" $MAIN_CLASS >${LOG_HOME}/${INSTANCE_NAME}/stdout.log 2>&1 & # 保存PID echo $! > $PID_FILE