Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improve]Improve log path #98

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
-->
<configuration scan="true" scanPeriod="10 seconds">
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<property name="APP_LOG_PATH" value="./logs" />
<property name="APP_LOG_PATH" value="${seatunnel-web.logs.path}/" />
<property name="HOST_NAME" value="${HOSTNAME:-UNKNOWN}"/>
<property name="TRACE" value="[tr:%X{X-B3-TraceId:-},sp:%X{X-B3-SpanId:-}]"/>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
Expand All @@ -27,11 +27,11 @@
</encoder>
</appender>

<appender name="thirdPartyAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${APP_LOG_PATH}/thirdParty.${APP_NAME}.log</file>
<appender name="seatunnel-web" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${APP_LOG_PATH}/seatunnel-web.log</file>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<FileNamePattern>${APP_LOG_PATH}/thirdParty.${APP_NAME}.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<FileNamePattern>${APP_LOG_PATH}/seatunnel-web.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<MaxHistory>30</MaxHistory>
<MaxFileSize>100MB</MaxFileSize>
</rollingPolicy>
Expand All @@ -41,16 +41,8 @@
</encoder>
</appender>

<logger name="org.apache.seatunnel.app.dal.mapper" level="DEBUG" additivity="false">
<appender-ref ref="console" />
</logger>

<logger name="org.springframework" level="INFO" additivity="false">
<appender-ref ref="thirdPartyAppender" />
<appender-ref ref="console" />
</logger>

<root level="INFO">
<appender-ref ref="seatunnel-web" />
<appender-ref ref="console" />
</root>
</configuration>
Loading