From 23f8065d91f239b7e4203030d1e58dd0f38e4ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=A0=E7=A5=A5?= Date: Tue, 12 Mar 2024 20:02:47 +0800 Subject: [PATCH 1/7] add version to the console banner --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 1 + .../seata/server/ServerApplication.java | 19 ++++++++++++++++++- server/src/main/resources/banner.txt | 7 ------- 4 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 server/src/main/resources/banner.txt diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index 64b06a9ec22..dba6c251f11 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -109,6 +109,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#6393](https://github.com/apache/incubator-seata/pull/6393)] determine the version before sync metadata and add retry mechanism - [[#6387](https://github.com/apache/incubator-seata/pull/6387)] optimize tcc use compatible - [[#6402](https://github.com/apache/incubator-seata/pull/6402)] optimize rm-datasource use compatible +- [[#6416](https://github.com/apache/incubator-seata/pull/6416)] add version to the console banner ### refactor: - [[#6269](https://github.com/apache/incubator-seata/pull/6269)] standardize Seata Exception diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index fb990bd9563..dc556a78bf8 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -113,6 +113,7 @@ - [[#6393](https://github.com/apache/incubator-seata/pull/6393)] 元数据同步前判断版本,并增加重试功能 - [[#6387](https://github.com/apache/incubator-seata/pull/6387)] 优化tcc使用兼容 - [[#6402](https://github.com/apache/incubator-seata/pull/6402)] 优化rm-datasource向下兼容 +- [[#6416](https://github.com/apache/incubator-seata/pull/6416)] 控制台banner添加版本号 ### refactor: diff --git a/server/src/main/java/org/apache/seata/server/ServerApplication.java b/server/src/main/java/org/apache/seata/server/ServerApplication.java index 952187137e3..a665289fae7 100644 --- a/server/src/main/java/org/apache/seata/server/ServerApplication.java +++ b/server/src/main/java/org/apache/seata/server/ServerApplication.java @@ -18,15 +18,32 @@ import java.io.IOException; +import org.apache.seata.core.protocol.Version; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** + * Server Application */ @SpringBootApplication(scanBasePackages = {"org.apache.seata"}) public class ServerApplication { public static void main(String[] args) throws IOException { // run the spring-boot application - SpringApplication.run(ServerApplication.class, args); + SpringApplication app = new SpringApplication(ServerApplication.class); + // set the banner and version information + app.setBanner((environment, sourceClass, out) -> { + out.println("===================================================================="); + out.println(" _ _____ _ \n" + + " /\\ | | / ____| | | \n" + + " / \\ _ __ __ _ ___| |__ ___ | (___ ___ __ _| |_ __ _ \n" + + " / /\\ \\ | '_ \\ / _` |/ __| '_ \\ / _ \\ \\___ \\ / _ \\/ _` | __/ _` |\n" + + " / ____ \\| |_) | (_| | (__| | | | __/ ____) | __/ (_| | || (_| |\n" + + "/_/ \\_\\ .__/ \\__,_|\\___|_| |_|\\___| |_____/ \\___|\\__,_|\\__\\__,_|\n" + + " | | \n" + + " |_| \n"); + out.println(" Current Version: " + Version.getCurrent()); + out.println("===================================================================="); + }); + app.run(args); } } diff --git a/server/src/main/resources/banner.txt b/server/src/main/resources/banner.txt deleted file mode 100644 index e561e763b52..00000000000 --- a/server/src/main/resources/banner.txt +++ /dev/null @@ -1,7 +0,0 @@ -███████╗███████╗ █████╗ ████████╗ █████╗ -██╔════╝██╔════╝██╔══██╗╚══██╔══╝██╔══██╗ -███████╗█████╗ ███████║ ██║ ███████║ -╚════██║██╔══╝ ██╔══██║ ██║ ██╔══██║ -███████║███████╗██║ ██║ ██║ ██║ ██║ -╚══════╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ - From 9d7f9513af23567cb768c3014c467b17b23e2489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=A0=E7=A5=A5?= Date: Tue, 12 Mar 2024 20:06:00 +0800 Subject: [PATCH 2/7] add version to the console banner --- changes/en-us/2.x.md | 2 +- changes/zh-cn/2.x.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index dba6c251f11..ead0700375c 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -109,7 +109,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#6393](https://github.com/apache/incubator-seata/pull/6393)] determine the version before sync metadata and add retry mechanism - [[#6387](https://github.com/apache/incubator-seata/pull/6387)] optimize tcc use compatible - [[#6402](https://github.com/apache/incubator-seata/pull/6402)] optimize rm-datasource use compatible -- [[#6416](https://github.com/apache/incubator-seata/pull/6416)] add version to the console banner +- [[#6417](https://github.com/apache/incubator-seata/pull/6417)] add version to the console banner ### refactor: - [[#6269](https://github.com/apache/incubator-seata/pull/6269)] standardize Seata Exception diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index dc556a78bf8..31342e824c1 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -113,7 +113,7 @@ - [[#6393](https://github.com/apache/incubator-seata/pull/6393)] 元数据同步前判断版本,并增加重试功能 - [[#6387](https://github.com/apache/incubator-seata/pull/6387)] 优化tcc使用兼容 - [[#6402](https://github.com/apache/incubator-seata/pull/6402)] 优化rm-datasource向下兼容 -- [[#6416](https://github.com/apache/incubator-seata/pull/6416)] 控制台banner添加版本号 +- [[#6417](https://github.com/apache/incubator-seata/pull/6417)] 控制台banner添加版本号 ### refactor: From 52149526e51b73d9a4a3263c159eea0da80ec533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=A0=E7=A5=A5?= Date: Mon, 29 Apr 2024 14:32:37 +0800 Subject: [PATCH 3/7] update:update the banner --- .../apache/seata/server/ServerApplication.java | 18 ++---------------- server/src/main/resources/banner.txt | 10 ++++++++++ 2 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 server/src/main/resources/banner.txt diff --git a/server/src/main/java/org/apache/seata/server/ServerApplication.java b/server/src/main/java/org/apache/seata/server/ServerApplication.java index a665289fae7..6345a2d0d1b 100644 --- a/server/src/main/java/org/apache/seata/server/ServerApplication.java +++ b/server/src/main/java/org/apache/seata/server/ServerApplication.java @@ -29,21 +29,7 @@ public class ServerApplication { public static void main(String[] args) throws IOException { // run the spring-boot application - SpringApplication app = new SpringApplication(ServerApplication.class); - // set the banner and version information - app.setBanner((environment, sourceClass, out) -> { - out.println("===================================================================="); - out.println(" _ _____ _ \n" + - " /\\ | | / ____| | | \n" + - " / \\ _ __ __ _ ___| |__ ___ | (___ ___ __ _| |_ __ _ \n" + - " / /\\ \\ | '_ \\ / _` |/ __| '_ \\ / _ \\ \\___ \\ / _ \\/ _` | __/ _` |\n" + - " / ____ \\| |_) | (_| | (__| | | | __/ ____) | __/ (_| | || (_| |\n" + - "/_/ \\_\\ .__/ \\__,_|\\___|_| |_|\\___| |_____/ \\___|\\__,_|\\__\\__,_|\n" + - " | | \n" + - " |_| \n"); - out.println(" Current Version: " + Version.getCurrent()); - out.println("===================================================================="); - }); - app.run(args); + System.out.println("current version:"+Version.getCurrent()); + SpringApplication.run(ServerApplication.class, args); } } diff --git a/server/src/main/resources/banner.txt b/server/src/main/resources/banner.txt new file mode 100644 index 00000000000..784caf76832 --- /dev/null +++ b/server/src/main/resources/banner.txt @@ -0,0 +1,10 @@ + _ _____ _ + /\ | | / ____| | | + / \ _ __ __ _ ___| |__ ___ | (___ ___ __ _| |_ __ _ + / /\ \ | '_ \ / _` |/ __| '_ \ / _ \ \___ \ / _ \/ _` | __/ _` | + / ____ \| |_) | (_| | (__| | | | __/ ____) | __/ (_| | || (_| | +/_/ \_\ .__/ \__,_|\___|_| |_|\___| |_____/ \___|\__,_|\__\__,_| + | | + |_| +github:https://github.com/apache/incubator-seata +document:https://seata.apache.org From 8a2ef16e8d700d58d1ca199bf288bab3b864c892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=A0=E7=A5=A5?= Date: Mon, 29 Apr 2024 14:42:00 +0800 Subject: [PATCH 4/7] update:update the banner --- .../main/java/org/apache/seata/server/ServerApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/apache/seata/server/ServerApplication.java b/server/src/main/java/org/apache/seata/server/ServerApplication.java index 6345a2d0d1b..b0dc325095b 100644 --- a/server/src/main/java/org/apache/seata/server/ServerApplication.java +++ b/server/src/main/java/org/apache/seata/server/ServerApplication.java @@ -29,7 +29,7 @@ public class ServerApplication { public static void main(String[] args) throws IOException { // run the spring-boot application - System.out.println("current version:"+Version.getCurrent()); + System.out.println("current version:" + Version.getCurrent()); SpringApplication.run(ServerApplication.class, args); } } From 1e6a750b0be73cd4189af503403799dd13bfe224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=A0=E7=A5=A5?= Date: Mon, 29 Apr 2024 14:55:26 +0800 Subject: [PATCH 5/7] update:update the banner --- .../java/org/apache/seata/server/ServerApplication.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/apache/seata/server/ServerApplication.java b/server/src/main/java/org/apache/seata/server/ServerApplication.java index b0dc325095b..c9b5d7915d5 100644 --- a/server/src/main/java/org/apache/seata/server/ServerApplication.java +++ b/server/src/main/java/org/apache/seata/server/ServerApplication.java @@ -19,6 +19,8 @@ import java.io.IOException; import org.apache.seata.core.protocol.Version; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -27,9 +29,11 @@ */ @SpringBootApplication(scanBasePackages = {"org.apache.seata"}) public class ServerApplication { + private static final Logger LOGGER = LoggerFactory.getLogger(ServerApplication.class); + public static void main(String[] args) throws IOException { // run the spring-boot application - System.out.println("current version:" + Version.getCurrent()); + LOGGER.info("current version: {}", Version.getCurrent()); SpringApplication.run(ServerApplication.class, args); } } From bf21e2296a336722c2e1aab94f4fa07b6cadeaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=A0=E7=A5=A5?= Date: Mon, 29 Apr 2024 15:19:51 +0800 Subject: [PATCH 6/7] update:update the banner --- changes/en-us/2.x.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index 4e1d7565d4b..b34c0c198ea 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -113,7 +113,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#6387](https://github.com/apache/incubator-seata/pull/6387)] optimize tcc use compatible - [[#6402](https://github.com/apache/incubator-seata/pull/6402)] optimize rm-datasource use compatible - [[#6417](https://github.com/apache/incubator-seata/pull/6417)] add version to the console banner -- [[#6419](https://github.com/apache/incubator-seata/pull/6419)] optimize integration-tx-api compatibl +- [[#6419](https://github.com/apache/incubator-seata/pull/6419)] optimize integration-tx-api compatible ### refactor: - [[#6269](https://github.com/apache/incubator-seata/pull/6269)] standardize Seata Exception From feb917b6fb49c4050bd906c13abccd991d496acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E5=BF=A0=E7=A5=A5?= Date: Tue, 30 Apr 2024 15:37:54 +0800 Subject: [PATCH 7/7] =?UTF-8?q?update:=E8=A7=A6=E5=8F=91=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/main/resources/banner.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/resources/banner.txt b/server/src/main/resources/banner.txt index 784caf76832..684cdfda91b 100644 --- a/server/src/main/resources/banner.txt +++ b/server/src/main/resources/banner.txt @@ -6,5 +6,5 @@ /_/ \_\ .__/ \__,_|\___|_| |_|\___| |_____/ \___|\__,_|\__\__,_| | | |_| -github:https://github.com/apache/incubator-seata document:https://seata.apache.org +github:https://github.com/apache/incubator-seata