Browse Source

[Fix-#7480] [Standalone] add logger server (#7481)

* Change build context to avoid cache

Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
3.0.0/version-upgrade
Kerwin 3 years ago committed by GitHub
parent
commit
146471eb48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      dolphinscheduler-standalone-server/pom.xml
  2. 4
      dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java
  3. 51
      dolphinscheduler-standalone-server/src/main/resources/logback-spring.xml
  4. 11
      pom.xml

5
dolphinscheduler-standalone-server/pom.xml

@ -45,6 +45,11 @@
<artifactId>dolphinscheduler-alert-server</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-log-server</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-test</artifactId>

4
dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java

@ -17,6 +17,8 @@
package org.apache.dolphinscheduler;
import org.apache.dolphinscheduler.server.log.LoggerServer;
import org.apache.curator.test.TestingServer;
import org.springframework.boot.SpringApplication;
@ -27,7 +29,7 @@ public class StandaloneServer {
public static void main(String[] args) throws Exception {
final TestingServer server = new TestingServer(true);
System.setProperty("registry.zookeeper.connect-string", server.getConnectString());
new LoggerServer().start();
SpringApplication.run(StandaloneServer.class, args);
}
}

51
dolphinscheduler-standalone-server/src/main/resources/logback-spring.xml

@ -17,6 +17,8 @@
-->
<configuration scan="true" scanPeriod="120 seconds">
<property name="log.base" value="logs"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
@ -26,11 +28,58 @@
</encoder>
</appender>
<appender name="STANDALONELOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.base}/dolphinscheduler-standalone.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-standalone.%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>
<logger name="org.apache.zookeeper" level="WARN"/>
<logger name="org.apache.hbase" level="WARN"/>
<logger name="org.apache.hadoop" level="WARN"/>
<conversionRule conversionWord="messsage"
converterClass="org.apache.dolphinscheduler.server.log.SensitiveDataConverter"/>
<appender name="TASKLOGFILE" class="ch.qos.logback.classic.sift.SiftingAppender">
<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>
<root level="INFO">
<appender-ref ref="STDOUT"/>
<if condition="${DOCKER:-false}">
<then>
<appender-ref ref="STDOUT"/>
</then>
</if>
<appender-ref ref="STANDALONELOGFILE"/>
<appender-ref ref="TASKLOGFILE"/>
</root>
</configuration>

11
pom.xml

@ -240,6 +240,11 @@
<artifactId>dolphinscheduler-worker</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-log-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dolphinscheduler</groupId>
<artifactId>dolphinscheduler-standalone-server</artifactId>
@ -939,11 +944,12 @@
<workingDirectory>${project.basedir}</workingDirectory>
<arguments>
<argument>build</argument>
<argument>--no-cache</argument>
<argument>-t</argument>
<argument>${docker.hub}/${docker.repo}:${docker.tag}</argument>
<argument>-t</argument>
<argument>${docker.hub}/${docker.repo}:latest</argument>
<argument>.</argument>
<argument>${project.basedir}</argument>
<argument>--file=src/main/docker/Dockerfile</argument>
</arguments>
</configuration>
@ -963,12 +969,13 @@
<arguments>
<argument>buildx</argument>
<argument>build</argument>
<argument>--no-cache</argument>
<argument>--push</argument>
<argument>-t</argument>
<argument>${docker.hub}/${docker.repo}:${docker.tag}</argument>
<argument>-t</argument>
<argument>${docker.hub}/${docker.repo}:latest</argument>
<argument>.</argument>
<argument>${project.basedir}</argument>
<argument>--file=src/main/docker/Dockerfile</argument>
</arguments>
</configuration>

Loading…
Cancel
Save