From 4c414a3ad3ffa3ee91a1d432301baa11f0ded71a Mon Sep 17 00:00:00 2001 From: gaojun Date: Tue, 8 Aug 2023 18:44:45 +0800 Subject: [PATCH] [Improve]Improve log path --- .../src/main/bin/seatunnel-backend-daemon.sh | 7 +++---- .../src/main/resources/logback-spring.xml | 18 +++++------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/seatunnel-server/seatunnel-app/src/main/bin/seatunnel-backend-daemon.sh b/seatunnel-server/seatunnel-app/src/main/bin/seatunnel-backend-daemon.sh index 78f6cf5c1..eef62beb7 100644 --- a/seatunnel-server/seatunnel-app/src/main/bin/seatunnel-backend-daemon.sh +++ b/seatunnel-server/seatunnel-app/src/main/bin/seatunnel-backend-daemon.sh @@ -28,7 +28,7 @@ start() { JAVA_OPTS="${JAVA_OPTS} -server -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof" SPRING_OPTS="${SPRING_OPTS} -Dspring.config.name=application.yml -Dspring.config.location=classpath:application.yml" - + JAVA_OPTS="${JAVA_OPTS} -Dseatunnel-web.logs.path=${WORKDIR}/../logs" # check env JAVA_HOME if [ -z "$JAVA_HOME" ]; then echo "JAVA_HOME is not set" @@ -39,14 +39,13 @@ start() { nohup $JAVA_HOME/bin/java $JAVA_OPTS \ -cp "$WORKDIR/../conf":"$WORKDIR/../libs/*":"$WORKDIR/../datasource/*" \ $SPRING_OPTS \ - org.apache.seatunnel.app.SeatunnelApplication - > seatunnel.log 2>&1 & + org.apache.seatunnel.app.SeatunnelApplication 2>&1 & echo "seatunnel started" } # stop stop() { echo "stopping seatunnel..." - pid=$(jcmd | grep -i 'seatunnel-app-.*jar' | grep -v grep | awk '{print $1}') + pid=$(jcmd | grep -i 'org.apache.seatunnel.app.SeatunnelApplication' | grep -v grep | awk '{print $1}') if [ -n "$pid" ]; then kill -15 $pid echo "seatunnel stopped" diff --git a/seatunnel-server/seatunnel-app/src/main/resources/logback-spring.xml b/seatunnel-server/seatunnel-app/src/main/resources/logback-spring.xml index eb41353f7..07d960525 100644 --- a/seatunnel-server/seatunnel-app/src/main/resources/logback-spring.xml +++ b/seatunnel-server/seatunnel-app/src/main/resources/logback-spring.xml @@ -15,7 +15,7 @@ --> - + @@ -27,11 +27,11 @@ - - ${APP_LOG_PATH}/thirdParty.${APP_NAME}.log + + ${APP_LOG_PATH}/seatunnel-web.log true - ${APP_LOG_PATH}/thirdParty.${APP_NAME}.log.%d{yyyy-MM-dd}.%i.log + ${APP_LOG_PATH}/seatunnel-web.log.%d{yyyy-MM-dd}.%i.log 30 100MB @@ -41,16 +41,8 @@ - - - - - - - - - +