You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/10/15 14:41:58 UTC
[dolphinscheduler] branch 1.3.9-prepare updated: [Task]add
standalone logback config
This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch 1.3.9-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/1.3.9-prepare by this push:
new 9b83d05 [Task]add standalone logback config
9b83d05 is described below
commit 9b83d05390ae5d9315970e3831e2d74a51388b70
Author: CalvinKirs <ki...@apache.org>
AuthorDate: Fri Oct 15 22:41:46 2021 +0800
[Task]add standalone logback config
---
.../logback/logback-standalone.xml | 144 +++++++++++++++++++++
.../src/main/resources/logback-standalone.xml | 144 +++++++++++++++++++++
script/dolphinscheduler-daemon.sh | 1 +
3 files changed, 289 insertions(+)
diff --git a/docker/build/conf/dolphinscheduler/logback/logback-standalone.xml b/docker/build/conf/dolphinscheduler/logback/logback-standalone.xml
new file mode 100644
index 0000000..2376c4b
--- /dev/null
+++ b/docker/build/conf/dolphinscheduler/logback/logback-standalone.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
+<configuration scan="true" scanPeriod="120 seconds"> <!--debug="true" -->
+
+ <property name="log.base" value="logs"/>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+ <appender name="ALERTLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.base}/dolphinscheduler-alert.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log.base}/dolphinscheduler-alert.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+ <maxHistory>20</maxHistory>
+ <maxFileSize>64MB</maxFileSize>
+ </rollingPolicy>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+
+
+ <!-- api server logback config start -->
+ <appender name="APILOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.base}/dolphinscheduler-api.log</file>
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log.base}/dolphinscheduler-api.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+ <maxHistory>168</maxHistory>
+ <maxFileSize>64MB</maxFileSize>
+ </rollingPolicy>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+
+ <conversionRule conversionWord="messsage"
+ converterClass="org.apache.dolphinscheduler.server.log.SensitiveDataConverter"/>
+ <appender name="TASKLOGFILE" class="ch.qos.logback.classic.sift.SiftingAppender">
+ <!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter> -->
+ <filter class="org.apache.dolphinscheduler.server.log.TaskLogFilter"/>
+ <Discriminator class="org.apache.dolphinscheduler.server.log.TaskLogDiscriminator">
+ <key>taskAppId</key>
+ <logBase>${log.base}</logBase>
+ </Discriminator>
+ <sift>
+ <appender name="FILE-${taskAppId}" class="ch.qos.logback.core.FileAppender">
+ <file>${log.base}/${taskAppId}.log</file>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ <append>true</append>
+ </appender>
+ </sift>
+ </appender>
+ <!-- master server logback config start -->
+ <appender name="MASTERLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.base}/dolphinscheduler-master.log</file>
+ <!--<filter class="org.apache.dolphinscheduler.server.log.MasterLogFilter">
+ <level>INFO</level>
+ </filter>-->
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log.base}/dolphinscheduler-master.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+ <maxHistory>168</maxHistory>
+ <maxFileSize>200MB</maxFileSize>
+ </rollingPolicy>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+ <appender name="WORKERLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.base}/dolphinscheduler-worker.log</file>
+ <!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter> -->
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log.base}/dolphinscheduler-worker.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+ <maxHistory>168</maxHistory>
+ <maxFileSize>200MB</maxFileSize>
+ </rollingPolicy>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+ <!-- skywalking log reporter start-->
+ <appender name="SKYWALKING-LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender"/>
+ <!-- skywalking log reporter end-->
+
+ <root level="INFO">
+ <appender-ref ref="STDOUT"/>
+ <appender-ref ref="APILOGFILE"/>
+ <appender-ref ref="ALERTLOGFILE"/>
+ <appender-ref ref="TASKLOGFILE"/>
+ <appender-ref ref="MASTERLOGFILE"/>
+ <appender-ref ref="WORKERLOGFILE"/>
+ <appender-ref ref="SKYWALKING-LOG"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/dolphinscheduler-standalone-server/src/main/resources/logback-standalone.xml b/dolphinscheduler-standalone-server/src/main/resources/logback-standalone.xml
new file mode 100644
index 0000000..2376c4b
--- /dev/null
+++ b/dolphinscheduler-standalone-server/src/main/resources/logback-standalone.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
+<configuration scan="true" scanPeriod="120 seconds"> <!--debug="true" -->
+
+ <property name="log.base" value="logs"/>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+ <appender name="ALERTLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.base}/dolphinscheduler-alert.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log.base}/dolphinscheduler-alert.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+ <maxHistory>20</maxHistory>
+ <maxFileSize>64MB</maxFileSize>
+ </rollingPolicy>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+
+
+ <!-- api server logback config start -->
+ <appender name="APILOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.base}/dolphinscheduler-api.log</file>
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log.base}/dolphinscheduler-api.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+ <maxHistory>168</maxHistory>
+ <maxFileSize>64MB</maxFileSize>
+ </rollingPolicy>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+
+ <conversionRule conversionWord="messsage"
+ converterClass="org.apache.dolphinscheduler.server.log.SensitiveDataConverter"/>
+ <appender name="TASKLOGFILE" class="ch.qos.logback.classic.sift.SiftingAppender">
+ <!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter> -->
+ <filter class="org.apache.dolphinscheduler.server.log.TaskLogFilter"/>
+ <Discriminator class="org.apache.dolphinscheduler.server.log.TaskLogDiscriminator">
+ <key>taskAppId</key>
+ <logBase>${log.base}</logBase>
+ </Discriminator>
+ <sift>
+ <appender name="FILE-${taskAppId}" class="ch.qos.logback.core.FileAppender">
+ <file>${log.base}/${taskAppId}.log</file>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ <append>true</append>
+ </appender>
+ </sift>
+ </appender>
+ <!-- master server logback config start -->
+ <appender name="MASTERLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.base}/dolphinscheduler-master.log</file>
+ <!--<filter class="org.apache.dolphinscheduler.server.log.MasterLogFilter">
+ <level>INFO</level>
+ </filter>-->
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log.base}/dolphinscheduler-master.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+ <maxHistory>168</maxHistory>
+ <maxFileSize>200MB</maxFileSize>
+ </rollingPolicy>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+ <appender name="WORKERLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${log.base}/dolphinscheduler-worker.log</file>
+ <!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter> -->
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${log.base}/dolphinscheduler-worker.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
+ <maxHistory>168</maxHistory>
+ <maxFileSize>200MB</maxFileSize>
+ </rollingPolicy>
+ <encoder>
+ <pattern>
+ [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n
+ </pattern>
+ <charset>UTF-8</charset>
+ </encoder>
+ </appender>
+
+ <!-- skywalking log reporter start-->
+ <appender name="SKYWALKING-LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender"/>
+ <!-- skywalking log reporter end-->
+
+ <root level="INFO">
+ <appender-ref ref="STDOUT"/>
+ <appender-ref ref="APILOGFILE"/>
+ <appender-ref ref="ALERTLOGFILE"/>
+ <appender-ref ref="TASKLOGFILE"/>
+ <appender-ref ref="MASTERLOGFILE"/>
+ <appender-ref ref="WORKERLOGFILE"/>
+ <appender-ref ref="SKYWALKING-LOG"/>
+ </root>
+
+</configuration>
\ No newline at end of file
diff --git a/script/dolphinscheduler-daemon.sh b/script/dolphinscheduler-daemon.sh
index e7de6fa..7a7f577 100755
--- a/script/dolphinscheduler-daemon.sh
+++ b/script/dolphinscheduler-daemon.sh
@@ -84,6 +84,7 @@ elif [ "$command" = "logger-server" ]; then
HEAP_OPTS="-Xms1g -Xmx1g -Xmn512m"
export DOLPHINSCHEDULER_OPTS="$HEAP_OPTS $DOLPHINSCHEDULER_OPTS $LOGGER_SERVER_OPTS"
elif [ "$command" = "standalone-server" ]; then
+ LOG_FILE="-Dlogging.config=classpath:logback-standalone.xml"
CLASS=org.apache.dolphinscheduler.server.StandaloneServer
else
echo "Error: No command named '$command' was found."