From 146471eb487293684be81a0697b2bb56c86bb187 Mon Sep 17 00:00:00 2001 From: Kerwin <37063904+zhuangchong@users.noreply.github.com> Date: Thu, 23 Dec 2021 00:54:44 +0800 Subject: [PATCH] [Fix-#7480] [Standalone] add logger server (#7481) * Change build context to avoid cache Co-authored-by: kezhenxu94 --- dolphinscheduler-standalone-server/pom.xml | 5 ++ .../dolphinscheduler/StandaloneServer.java | 4 +- .../src/main/resources/logback-spring.xml | 51 ++++++++++++++++++- pom.xml | 11 +++- 4 files changed, 67 insertions(+), 4 deletions(-) diff --git a/dolphinscheduler-standalone-server/pom.xml b/dolphinscheduler-standalone-server/pom.xml index 6f854d5fc9..4c4b2fd902 100644 --- a/dolphinscheduler-standalone-server/pom.xml +++ b/dolphinscheduler-standalone-server/pom.xml @@ -45,6 +45,11 @@ dolphinscheduler-alert-server + + org.apache.dolphinscheduler + dolphinscheduler-log-server + + org.apache.curator curator-test diff --git a/dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java b/dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java index 13e1ea006e..ac87a8a0e3 100644 --- a/dolphinscheduler-standalone-server/src/main/java/org/apache/dolphinscheduler/StandaloneServer.java +++ b/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); } } diff --git a/dolphinscheduler-standalone-server/src/main/resources/logback-spring.xml b/dolphinscheduler-standalone-server/src/main/resources/logback-spring.xml index 95fb54e0d1..8e135e443b 100644 --- a/dolphinscheduler-standalone-server/src/main/resources/logback-spring.xml +++ b/dolphinscheduler-standalone-server/src/main/resources/logback-spring.xml @@ -17,6 +17,8 @@ --> + + @@ -26,11 +28,58 @@ + + ${log.base}/dolphinscheduler-standalone.log + + INFO + + + ${log.base}/dolphinscheduler-standalone.%d{yyyy-MM-dd_HH}.%i.log + 168 + 200MB + + + + [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n + + UTF-8 + + + + + + + + taskAppId + ${log.base} + + + + ${log.base}/${taskAppId}.log + + + [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n + + UTF-8 + + true + + + + - + + + + + + + + diff --git a/pom.xml b/pom.xml index ead2079648..e9ec48e53a 100644 --- a/pom.xml +++ b/pom.xml @@ -240,6 +240,11 @@ dolphinscheduler-worker ${project.version} + + org.apache.dolphinscheduler + dolphinscheduler-log-server + ${project.version} + org.apache.dolphinscheduler dolphinscheduler-standalone-server @@ -939,11 +944,12 @@ ${project.basedir} build + --no-cache -t ${docker.hub}/${docker.repo}:${docker.tag} -t ${docker.hub}/${docker.repo}:latest - . + ${project.basedir} --file=src/main/docker/Dockerfile @@ -963,12 +969,13 @@ buildx build + --no-cache --push -t ${docker.hub}/${docker.repo}:${docker.tag} -t ${docker.hub}/${docker.repo}:latest - . + ${project.basedir} --file=src/main/docker/Dockerfile