This is an automated email from the ASF dual-hosted git repository.
hefengen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new bf61e5e08 feature shenyu-plugin:add shenyu-plugin-logging-huawei-lts
(#4812)
bf61e5e08 is described below
commit bf61e5e08aa80aa9f4c7ea8ebc37b0913c21ce1c
Author: NanMu <[email protected]>
AuthorDate: Thu Jul 13 21:25:33 2023 +0800
feature shenyu-plugin:add shenyu-plugin-logging-huawei-lts (#4812)
* 完成华为云日志插件(包括测试类)的开发
* 完成华为云日志插件starter(包括测试类)的开发
* 正在解决依赖冲突
* 华为云日志插件完成开发
* add licenses
* add licenses
* add
* add1
* improve code
* improve code
* improve code
* improve code
* improve code
* improve code
* add loggingHuaweiLts sql
* add loggingHuaweiLts sql
* add loggingHuaweiLts comment
* add loggingHuaweiLts comment
* test huawei-plugin
* test huawei-plugin
* add
* Delete Test.java
* add LICENSE
* add loggingHuaweiLts h2 sql
* trigger ci
* update pom
* improve code
* improve code
* print log
* print log
* print log
* print log
* print log
* [type:log] print log
* [type:log] print log
* update sql
* [type:log] print log.
* [type:log] print log.
* [type:log] print log.
* trigger ci
* add upgrade.sql
* add upgrade.sql
* trigger ci
---------
Co-authored-by: ‘xcsnx’ <‘[email protected]’>
Co-authored-by: yunlongn <[email protected]>
---
db/init/mysql/schema.sql | 46 +-
db/init/oracle/schema.sql | 63 +++
db/init/pg/create-table.sql | 46 +-
db/upgrade/2.5.1-upgrade-2.6.0-mysql.sql | 47 +-
db/upgrade/2.5.1-upgrade-2.6.0-oracle.sql | 64 +++
db/upgrade/2.5.1-upgrade-2.6.0-pg.sql | 47 +-
pom.xml | 3 +-
.../src/main/resources/sql-script/h2/schema.sql | 44 ++
shenyu-bootstrap/pom.xml | 10 +
.../org/apache/shenyu/common/enums/PluginEnum.java | 5 +
.../src/main/release-docs/LICENSE | 2 +-
shenyu-plugin/shenyu-plugin-logging/pom.xml | 1 +
.../{ => shenyu-plugin-logging-huawei-lts}/pom.xml | 38 +-
.../plugin/huawei/lts/LoggingHuaweiLtsPlugin.java | 61 +++
.../lts/client/HuaweiLtsLogCollectClient.java | 212 +++++++++
.../lts/collector/HuaweiLtsLogCollector.java | 52 +++
.../huawei/lts/config/HuaweiLogCollectConfig.java | 485 +++++++++++++++++++++
.../handler/LoggingHuaweiLtsPluginDataHandler.java | 66 +++
.../huawei/lts/LoggingHuaweiLtsPluginTest.java | 104 +++++
.../lts/client/HuaweiLtsLogCollectClientTest.java | 87 ++++
.../lts/collector/HuaweiLtsLogCollectorTest.java | 58 +++
.../lts/config/HuaweiLogCollectConfigTest.java | 59 +++
.../LoggingHuaweiLtsPluginDataHandlerTest.java | 68 +++
.../shenyu-spring-boot-starter-plugin/pom.xml | 1 +
.../pom.xml | 24 +-
.../lts/LoggingHuaweiLtsPluginConfiguration.java | 54 +++
.../src/main/resources/META-INF/spring.factories | 19 +
.../src/main/resources/META-INF/spring.provides | 18 +
.../LoggingHuaweiLtsPluginConfigurationTest.java | 49 +++
29 files changed, 1793 insertions(+), 40 deletions(-)
diff --git a/db/init/mysql/schema.sql b/db/init/mysql/schema.sql
index d89f115f9..d341753f2 100644
--- a/db/init/mysql/schema.sql
+++ b/db/init/mysql/schema.sql
@@ -759,6 +759,17 @@ INSERT INTO `permission` VALUES ('1534585531389583418',
'1346358560427216896', '
INSERT INTO `permission` VALUES ('1534585531389583419', '1346358560427216896',
'1534585531108565051', '2022-05-25 18:02:58', '2022-05-25 18:02:58');
INSERT INTO `permission` VALUES ('1534585531389583420', '1346358560427216896',
'1534585531108565052', '2022-05-25 18:02:58', '2022-05-25 18:02:58');
+INSERT INTO `permission` VALUES ('1572525965658820609', '1346358560427216896',
'1676471945048780800', '2023-07-07 23:20:04.962', '2023-07-07 23:20:14.170');
+INSERT INTO `permission` VALUES ('1572525965658820610', '1346358560427216896',
'1676471945124278272', '2023-07-07 23:21:23.648', '2023-07-07 23:21:23.648');
+INSERT INTO `permission` VALUES ('1572525965658820611', '1346358560427216896',
'1676471945124278273', '2023-07-07 23:23:40.409', '2023-07-07 23:23:40.409');
+INSERT INTO `permission` VALUES ('1572525965658820612', '1346358560427216896',
'1676471945124278274', '2023-07-07 23:24:03.398', '2023-07-07 23:24:03.398');
+INSERT INTO `permission` VALUES ('1572525965658820613', '1346358560427216896',
'1676471945124278275', '2023-07-07 23:24:19.165', '2023-07-07 23:24:19.165');
+INSERT INTO `permission` VALUES ('1572525965658820614', '1346358560427216896',
'1676471945124278276', '2023-07-07 23:24:52.339', '2023-07-07 23:24:52.339');
+INSERT INTO `permission` VALUES ('1572525965658820615', '1346358560427216896',
'1676471945124278277', '2023-07-07 23:25:30.528', '2023-07-07 23:25:30.528');
+INSERT INTO `permission` VALUES ('1572525965658820616', '1346358560427216896',
'1676471945124278278', '2023-07-07 23:25:50.772', '2023-07-07 23:25:50.772');
+INSERT INTO `permission` VALUES ('1572525965658820617', '1346358560427216896',
'1676471945124278279', '2023-07-07 23:26:11.518', '2023-07-07 23:26:11.518');
+INSERT INTO `permission` VALUES ('1572525965658820618', '1346358560427216896',
'1676471945124278280', '2023-07-07 23:26:37.388', '2023-07-07 23:26:37.388');
+
INSERT INTO `permission` VALUES ('1572525965658820608', '1346358560427216896',
'1572525965625266176', '2022-09-28 11:50:58', '2022-09-28 11:50:58');
-- ----------------------------
-- Table structure for plugin
@@ -820,7 +831,7 @@ INSERT INTO `plugin` VALUES ('39', 'casdoor',
'{\"endpoint\":\"http://localhost:
INSERT INTO `plugin` VALUES ('40', 'keyAuth', NULL, 'Authentication', 150, 0,
'2022-07-24 19:00:00', '2022-07-24 19:00:00',null);
INSERT INTO `plugin` VALUES ('41', 'brpc', '{\"address\":\"127.0.0.1\",
\"port\":\"8005\", \"corethreads\":0, \"threads\":2147483647, \"queues\":0,
\"threadpool\":\"shared\"}', 'Proxy', 310, 0, '2023-01-10 10:08:01',
'2023-01-10 10:08:01',null);
INSERT INTO `plugin` VALUES ('42', 'tcp', NULL, 'Proxy', 320, 1, '2023-05-30
18:02:53', '2022-05-30 18:02:53',null);
-
+INSERT INTO `plugin` VALUES ('43', 'loggingHuaweiLts',
'{\"totalSizeInBytes\":\"104857600\",\"maxBlockMs\":\"0\",\"ioThreadCount\":\"1\",\"batchSizeThresholdInBytes\":\"524288\",\"batchCountThreshold\":\"4096\",\"lingerMs\":\"2000\",\"retries\":\"100\",\"baseRetryBackoffMs\":\"100\",\"maxRetryBackoffMs\":\"100\",\"enableLocalTest\":\"true\",\"setGiveUpExtraLongSingleLog\":\"false\"}',
'Logging', 177, 0, '2023-07-05 14:03:53.686', '2023-07-06 12:42:07.234', NULL);
-- ----------------------------
-- Table structure for plugin_handle
-- ----------------------------
@@ -1117,6 +1128,28 @@ INSERT INTO `plugin_handle` VALUES
('1529402613204172959', '41', 'corethreads',
INSERT INTO `plugin_handle` VALUES ('1529402613204172960', '41', 'threads',
'threads', 1, 3, 0,
'{\"required\":\"0\",\"defaultValue\":\"2147483647\",\"placeholder\":\"threads\",\"rule\":\"\"}',
'2023-01-10 10:08:01.158', '2023-01-10 10:08:01.158');
INSERT INTO `plugin_handle` VALUES ('1529402613204172961', '41', 'queues',
'queues', 1, 3, 0,
'{\"required\":\"0\",\"defaultValue\":\"0\",\"placeholder\":\"queues\",\"rule\":\"\"}',
'2023-01-10 10:08:01.158', '2023-01-10 10:08:01.158');
INSERT INTO `plugin_handle` VALUES ('1529402613204172962', '41', 'threadpool',
'threadpool', 3, 3, 0,
'{\"required\":\"0\",\"defaultValue\":\"shared\",\"placeholder\":\"threadpool\",\"rule\":\"\"}',
'2023-01-10 10:08:01.158', '2023-01-10 10:08:01.158');
+
+INSERT INTO `plugin_handle` VALUES ('1676472478492946432', '43', 'projectId',
'projectId', 2, 3, 0, '{\"required\":\"1\",\"rule\":\"\"}', '2023-07-05
14:06:00.893', '2023-07-07 22:50:00.597');
+INSERT INTO `plugin_handle` VALUES ('1676473313352380416', '43', 'logGroupId',
'logGroupId', 2, 3, 1, '{\"required\":\"1\",\"rule\":\"\"}', '2023-07-05
14:09:19.928', '2023-07-07 22:50:00.606');
+INSERT INTO `plugin_handle` VALUES ('1676473453001732096', '43',
'logStreamId', 'logStreamId', 2, 3, 2, '{\"required\":\"1\",\"rule\":\"\"}',
'2023-07-05 14:09:53.224', '2023-07-07 22:50:00.607');
+INSERT INTO `plugin_handle` VALUES ('1676473657121730560', '43',
'accessKeyId', 'AccessKey', 2, 3, 4, '{\"required\":\"1\",\"rule\":\"\"}',
'2023-07-05 14:10:41.897', '2023-07-07 22:50:00.608');
+INSERT INTO `plugin_handle` VALUES ('1676474055324758016', '43',
'accessKeySecret', 'accessKey', 2, 3, 5, '{\"required\":\"1\",\"rule\":\"\"}',
'2023-07-05 14:12:16.828', '2023-07-07 22:50:00.609');
+INSERT INTO `plugin_handle` VALUES ('1676474340008947712', '43', 'regionName',
'regionName', 2, 3, 6, '{\"required\":\"1\",\"rule\":\"\"}', '2023-07-05
14:13:24.703', '2023-07-07 22:50:00.610');
+INSERT INTO `plugin_handle` VALUES ('1676474810655993856', '43',
'totalSizeInBytes', 'totalSizeInBytes', 1, 3, 8,
'{\"required\":\"0\",\"defaultValue\":\"104857600\",\"rule\":\"\"}',
'2023-07-05 14:15:16.913', '2023-07-07 22:50:00.611');
+INSERT INTO `plugin_handle` VALUES ('1676475051081887744', '43', 'maxBlockMs',
'maxBlockMs', 1, 3, 9,
'{\"required\":\"0\",\"defaultValue\":\"0\",\"rule\":\"\"}', '2023-07-05
14:16:14.236', '2023-07-07 22:50:00.612');
+INSERT INTO `plugin_handle` VALUES ('1676475293634293760', '43',
'ioThreadCount', 'ioThreadCount', 1, 3, 10,
'{\"required\":\"0\",\"defaultValue\":\"1\",\"rule\":\"\"}', '2023-07-05
14:17:12.065', '2023-07-07 22:50:00.612');
+INSERT INTO `plugin_handle` VALUES ('1676475611772252160', '43',
'batchSizeThresholdInBytes', 'batchSizeThresholdInBytes', 1, 3, 11,
'{\"required\":\"0\",\"defaultValue\":\"524288\",\"rule\":\"\"}', '2023-07-05
14:18:27.915', '2023-07-07 22:50:00.614');
+INSERT INTO `plugin_handle` VALUES ('1676475862545494016', '43',
'batchCountThreshold', 'batchCountThreshold', 1, 3, 12,
'{\"required\":\"0\",\"defaultValue\":\"4096\",\"rule\":\"\"}', '2023-07-05
14:19:27.704', '2023-07-07 22:50:00.615');
+INSERT INTO `plugin_handle` VALUES ('1676476047950508032', '43', 'lingerMs',
'lingerMs', 1, 3, 12,
'{\"required\":\"0\",\"defaultValue\":\"2000\",\"rule\":\"\"}', '2023-07-05
14:20:11.908', '2023-07-07 22:50:00.616');
+INSERT INTO `plugin_handle` VALUES ('1676476207938039808', '43', 'retries',
'retries', 1, 3, 13,
'{\"required\":\"0\",\"defaultValue\":\"100\",\"rule\":\"\"}', '2023-07-05
14:20:50.052', '2023-07-07 22:50:00.617');
+INSERT INTO `plugin_handle` VALUES ('1676476515359551488', '43',
'baseRetryBackoffMs', 'baseRetryBackoffMs', 1, 3, 14,
'{\"required\":\"0\",\"defaultValue\":\"100\",\"rule\":\"\"}', '2023-07-05
14:22:03.347', '2023-07-07 22:50:00.618');
+INSERT INTO `plugin_handle` VALUES ('1676476639779385344', '43',
'maxRetryBackoffMs', 'maxRetryBackoffMs', 1, 3, 15,
'{\"required\":\"0\",\"defaultValue\":\"100\",\"rule\":\"\"}', '2023-07-05
14:22:33.010', '2023-07-07 22:50:00.619');
+INSERT INTO `plugin_handle` VALUES ('1676477312923234304', '43',
'enableLocalTest', 'enableLocalTest', 2, 3, 15,
'{\"required\":\"0\",\"defaultValue\":\"false\",\"rule\":\"\"}', '2023-07-05
14:25:13.500', '2023-07-07 22:50:00.619');
+INSERT INTO `plugin_handle` VALUES ('1676477594361032704', '43',
'setGiveUpExtraLongSingleLog', 'setGiveUpExtraLongSingleLog', 2, 3, 16,
'{\"required\":\"0\",\"defaultValue\":\"false\",\"rule\":\"\"}', '2023-07-05
14:26:20.600', '2023-07-07 22:50:00.620');
+INSERT INTO `plugin_handle` VALUES ('1676477594361032705', '43', 'keyword',
'keyword', 2, 2, 0, '{\"required\":\"0\",\"placeholder\":\"please use ‘;’ to
split keyword\",\"rule\":\"\"}', '2023-07-05 14:26:20.600', '2023-07-07
22:50:00.620');
+INSERT INTO `plugin_handle` VALUES ('1676477594361032706', '43', 'maskType',
'maskType', 3, 2, 1,
'{\"required\":\"0\",\"defaultValue\":\"dataMaskByMD5\",\"rule\":\"\"}',
'2023-07-05 14:26:20.600', '2023-07-07 22:50:00.620');
+INSERT INTO `plugin_handle` VALUES ('1676477594361032707', '43', 'maskStatus',
'maskStatus', 3, 2, 2,
'{\"required\":\"0\",\"defaultValue\":\"false\",\"rule\":\"\"}','2023-07-05
14:26:20.600', '2023-07-07 22:50:00.620');
+
-- ----------------------------
-- Table structure for resource
-- ----------------------------
@@ -1558,6 +1591,17 @@ INSERT INTO `resource` VALUES ('1534585531108565050',
'1534585531108565043', 'SH
INSERT INTO `resource` VALUES ('1534585531108565051', '1534585531108565043',
'SHENYU.BUTTON.PLUGIN.RULE.DELETE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingClickHouseRule:delete', 1, '2022-05-25 18:02:58', '2022-05-25
18:02:58');
INSERT INTO `resource` VALUES ('1534585531108565052', '1534585531108565043',
'SHENYU.BUTTON.PLUGIN.SYNCHRONIZE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingClickHouse:modify', 1, '2022-05-25 18:02:58', '2022-05-25
18:02:58');
+INSERT INTO `resource` VALUES ('1676471945048780800', '1346775491550474240',
'loggingHuaweiLts', 'loggingHuaweiLts', '/plug/loggingHuaweiLts',
'loggingHuaweiLts', 1, 0, 'block', 0, 0, '', 1, '2023-07-05 14:03:53.699',
'2023-07-05 14:03:53.709');
+INSERT INTO `resource` VALUES ('1676471945124278272', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SELECTOR.ADD', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:add', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278273', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SELECTOR.DELETE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:delete', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278274', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SELECTOR.EDIT', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:edit', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278275', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SELECTOR.QUERY', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:query', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278276', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.RULE.ADD', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:add', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278277', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.RULE.DELETE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:delete', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278278', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.RULE.EDIT', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:edit', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278279', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.RULE.QUERY', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:query', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278280', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SYNCHRONIZE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLts:modify', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+
INSERT INTO `resource` VALUES ('1572525965625266176', '1346777449787125760',
'SHENYU.BUTTON.SYSTEM.RESOURCE', '', '', '',2, 6, '', 1, 0,
'system:plugin:resource', 1, '2022-09-28 11:50:58', '2022-09-28 11:50:58');
-- ----------------------------
-- Table structure for role
diff --git a/db/init/oracle/schema.sql b/db/init/oracle/schema.sql
index bac84be2a..dec5033e8 100644
--- a/db/init/oracle/schema.sql
+++ b/db/init/oracle/schema.sql
@@ -1140,6 +1140,8 @@ INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin(id)) */ INTO
plugin (id, name, conf
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin(id)) */ INTO plugin (id, name,
config, role, sort, enabled) VALUES ('39', 'casdoor',
'{"endpoint":"http://localhost:8000"}' ,'Authentication', 40, '0');
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin(id)) */ INTO plugin (id, name,
role, sort, enabled) VALUES ('40', 'keyAuth', 'Authentication', 150, '0');
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin(id)) */ INTO plugin (id, name,
role, sort, config, enabled) VALUES ('41', 'brpc', 'Proxy',
310,'{"address":"127.0.0.1","port":"8005","corethreads":0,"threads":2147483647,"queues":0,"threadpool":"shared"}','0');
+INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin(id)) */ INTO plugin (id, name,
role, sort, config, enabled) VALUES ('42', 'tcp', 'Proxy', 320, null, '1');
+INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin(id)) */ INTO plugin (id, name,
role, sort, config, enabled) VALUES ('43', 'loggingHuaweiLts', 'Logging', 177,
'{"totalSizeInBytes":"104857600","maxBlockMs":"0","ioThreadCount":"1","batchSizeThresholdInBytes":"524288","batchCountThreshold":"4096","lingerMs":"2000","retries":"100","baseRetryBackoffMs":"100","maxRetryBackoffMs":"100","enableLocalTest":"true","setGiveUpExtraLongSingleLog":"false"}','0');
@@ -1967,6 +1969,67 @@ values ('1518229897214468261', '38', 'engine', 'engine',
3, 3, 8, '{"required":"
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
VALUES ('1529402613204172862', '38', 'clusterName', 'clusterName', 3, 3, 9,
'{"required":"1","defaultValue":"cluster"}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172863', '43', 'projectId', 'projectId', 2, 3, 0,
'{"required":"1","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172864', '43', 'logGroupId', 'logGroupId', 2, 3, 1,
'{"required":"1","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172865', '43', 'logStreamId', 'logStreamId', 2, 3, 2,
'{"required":"1","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172866', '43', 'accessKeyId', 'AccessKey', 2, 3, 4,
'{"required":"1","placeholder":"accessKeyId","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172867', '43','accessKeySecret', 'accessKey', 2, 3, 5,
'{"required":"1","placeholder":"accessKeySecret","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172868', '43', 'regionName', 'regionName', 2, 3, 6,
'{"required":"1","placeholder":"regionName","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172869', '43', 'totalSizeInBytes', 'totalSizeInBytes',
1, 3, 8,
'{"required":"0","defaultValue":"104857600","placeholder":"totalSizeInBytes","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172870', '43', 'maxBlockMs', 'maxBlockMs', 1, 3, 9,
'{"required":"0","defaultValue":"0","placeholder":"maxBlockMs","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172871', '43', 'ioThreadCount', 'ioThreadCount', 1, 3,
10,
'{"required":"0","defaultValue":"1","placeholder":"ioThreadCount","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172872', '43', 'batchSizeThresholdInBytes',
'batchSizeThresholdInBytes', 1, 3, 11,
'{"required":"0","defaultValue":"524288","placeholder":"
batchSizeThresholdInBytes","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172873', '43', 'batchCountThreshold',
'batchCountThreshold', 1, 3, 12,
'{"required":"0","defaultValue":"4096","placeholder":"
batchCountThreshold","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172874', '43', 'lingerMs', 'lingerMs', 1, 3, 12,
'{"required":"0","defaultValue":"2000","placeholder":"lingerMs","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172875', '43', 'retries', 'retries', 1, 3, 13,
'{"required":"0","defaultValue":"100","placeholder":"retries","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172876', '43', 'baseRetryBackoffMs',
'baseRetryBackoffMs', 1, 3, 14,
'{"required":"0","defaultValue":"100","placeholder":"baseRetryBackoffMs","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172877', '43', 'maxRetryBackoffMs', 'maxRetryBackoffMs',
1, 3, 15,
'{"required":"0","defaultValue":"100","placeholder":"maxRetryBackoffMs","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172878', '43', 'enableLocalTest', 'enableLocalTest', 2,
3, 15,
'{"required":"0","defaultValue":"false","placeholder":"enableLocalTest","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172879', '43', 'setGiveUpExtraLongSingleLog',
'setGiveUpExtraLongSingleLog', 2, 3, 16,
'{"required":"0","defaultValue":"false","placeholder":"setGiveUpExtraLongSingleLog","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+values ('1529402613204172880', '43', 'maskStatus', 'maskStatus', 3, 2, 2,
'{"required":"0","defaultValue":"false","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+values ('1529402613204172881', '43', 'keyword', 'keyword', 2, 2, 0,
'{"required":"0","placeholder":"please use ‘;’ to split keyword","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+values ('1529402613204172882', '43', 'maskType', 'maskType', 3, 2, 1,
'{"required":"0","defaultValue":"dataMaskByMD5","rule":""}');
+
insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(shenyu_dict(type, dict_code, dict_name))
*/ into SHENYU_DICT (ID, TYPE, DICT_CODE, DICT_NAME, DICT_VALUE, "desc", SORT,
ENABLED)
VALUES ('1529402613195784272', 'securityProtocol', 'SECURITY_PROTOCOL',
'PLAINTEXT', 'PLAINTEXT', '', 1, 1);
diff --git a/db/init/pg/create-table.sql b/db/init/pg/create-table.sql
index 5b7fc3c50..412948f95 100644
--- a/db/init/pg/create-table.sql
+++ b/db/init/pg/create-table.sql
@@ -886,6 +886,17 @@ INSERT INTO "public"."permission" VALUES
('1529403932886044827', '13463585604272
INSERT INTO "public"."permission" VALUES ('1529403932886044828',
'1346358560427216896', '1534585531108565051', '2022-06-09 01:17:57',
'2022-06-09 01:17:56');
INSERT INTO "public"."permission" VALUES ('1529403932886044829',
'1346358560427216896', '1534585531108565052', '2022-06-09 01:17:57',
'2022-06-09 01:17:56');
+INSERT INTO "public"."permission" VALUES ('1572525965658820609',
'1346358560427216896', '1572525965625266177', '2023-07-07 23:20:04.962',
'2023-07-07 23:20:14.170');
+INSERT INTO "public"."permission" VALUES ('1572525965658820610',
'1346358560427216896', '1572525965625266178', '2023-07-07 23:21:23.648',
'2023-07-07 23:21:23.648');
+INSERT INTO "public"."permission" VALUES ('1572525965658820611',
'1346358560427216896', '1572525965625266179', '2023-07-07 23:23:40.409',
'2023-07-07 23:23:40.409');
+INSERT INTO "public"."permission" VALUES ('1572525965658820612',
'1346358560427216896', '1572525965625266180', '2023-07-07 23:24:03.398',
'2023-07-07 23:24:03.398');
+INSERT INTO "public"."permission" VALUES ('1572525965658820613',
'1346358560427216896', '1572525965625266181', '2023-07-07 23:24:19.165',
'2023-07-07 23:24:19.165');
+INSERT INTO "public"."permission" VALUES ('1572525965658820614',
'1346358560427216896', '1572525965625266182', '2023-07-07 23:24:52.339',
'2023-07-07 23:24:52.339');
+INSERT INTO "public"."permission" VALUES ('1572525965658820615',
'1346358560427216896', '1572525965625266183', '2023-07-07 23:25:30.528',
'2023-07-07 23:25:30.528');
+INSERT INTO "public"."permission" VALUES ('1572525965658820616',
'1346358560427216896', '1572525965625266184', '2023-07-07 23:25:50.772',
'2023-07-07 23:25:50.772');
+INSERT INTO "public"."permission" VALUES ('1572525965658820617',
'1346358560427216896', '1572525965625266185', '2023-07-07 23:26:11.518',
'2023-07-07 23:26:11.518');
+INSERT INTO "public"."permission" VALUES ('1572525965658820618',
'1346358560427216896', '1572525965625266186', '2023-07-07 23:26:37.388',
'2023-07-07 23:26:37.388');
+
INSERT INTO "public"."permission" VALUES ('1572525965658820608',
'1346358560427216896', '1572525965625266176', '2022-09-28 11:50:58',
'2022-09-28 11:50:58');
-- ----------------------------
-- Table structure for plugin
@@ -954,7 +965,8 @@ INSERT INTO "public"."plugin" VALUES ('38',
'loggingClickHouse', '{"host":"127.0
INSERT INTO "public"."plugin" VALUES ('39', 'casdoor',
'{"endpoint":"http://localhost:8000"}', 'Authentication', 40, 0, '2022-09-11
12:00:00', '2022-09-11 12:00:00', null);
INSERT INTO "public"."plugin" VALUES ('40', 'keyAuth', NULL, 'Authentication',
150, 0, '2022-07-24 19:00:00', '2022-07-24 19:00:00', null);
INSERT INTO "public"."plugin" VALUES ('41', 'brpc',
'{"address":"127.0.0.1","port":"8005","corethreads":0,"threads":2147483647,"queues":0,"threadpool":"shared"}',
'Proxy', 310, 0, '2023-01-10 10:08:01', '2023-01-10 10:08:01', null);
-
+INSERT INTO "public"."plugin" VALUES ('42', 'tcp', null, 'Proxy', 320, 1,
'2022-05-25 18:08:01', '2022-05-25 18:08:01', null);
+INSERT INTO "public"."plugin" VALUES ('43', 'loggingHuaweiLts', '{
"totalSizeInBytes":
"104857600","maxBlockMs":"0","ioThreadCount":"1","batchSizeThresholdInBytes":"524288","batchCountThreshold":"4096","lingerMs":"2000","retries":"100","baseRetryBackoffMs":"100","maxRetryBackoffMs":"100","enableLocalTest":"true","setGiveUpExtraLongSingleLog":"false"}',
'Logging', 177, 0, '2023-07-05 14:03:53', '2023-07-06 12:42:07', null);
-- ----------------------------
-- Table structure for plugin_handle
-- ----------------------------
@@ -1267,6 +1279,27 @@ INSERT INTO "public"."plugin_handle" VALUES
('1529402613204172959', '41', 'coret
INSERT INTO "public"."plugin_handle" VALUES ('1529402613204172960', '41',
'threads', 'threads', 1, 3, 0,
'{"required":"0","defaultValue":"2147483647","placeholder":"threads","rule":""}',
'2023-01-10 10:08:01', '2023-01-10 10:08:01');
INSERT INTO "public"."plugin_handle" VALUES ('1529402613204172961', '41',
'queues', 'queues', 1, 3, 0,
'{"required":"0","defaultValue":"0","placeholder":"queues","rule":""}',
'2023-01-10 10:08:01', '2023-01-10 10:08:01');
INSERT INTO "public"."plugin_handle" VALUES ('1529402613204172962', '41',
'threadpool', 'threadpool', 3, 3, 0,
'{"required":"0","defaultValue":"shared","placeholder":"threadpool","rule":""}',
'2023-01-10 10:08:01', '2023-01-10 10:08:01');
+
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312065', '43',
'projectId', 'projectId', 2, 3, 0, '{"required":"1","rule":""}', '2023-07-05
14:06:00.893', '2023-07-07 22:50:00.597');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312066', '43',
'logGroupId', 'logGroupId', 2, 3, 1, '{"required":"1","rule":""}', '2023-07-05
14:09:19.928', '2023-07-07 22:50:00.606');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312067', '43',
'logStreamId', 'logStreamId', 2, 3, 2, '{"required":"1","rule":""}',
'2023-07-05 14:09:53.224', '2023-07-07 22:50:00.607');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312068', '43',
'accessKeyId', 'AccessKey', 2, 3, 4, '{"required":"1","rule":""}', '2023-07-05
14:10:41.897', '2023-07-07 22:50:00.608');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312069', '43',
'accessKeySecret', 'accessKey', 2, 3, 5, '{"required":"1","rule":""}',
'2023-07-05 14:12:16.828', '2023-07-07 22:50:00.609');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312070', '43',
'regionName', 'regionName', 2, 3, 6, '{"required":"1","rule":""}', '2023-07-05
14:13:24.703', '2023-07-07 22:50:00.610');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312071', '43',
'totalSizeInBytes', 'totalSizeInBytes', 1, 3, 8,
'{"required":"0","defaultValue":"104857600","rule":""}', '2023-07-05
14:15:16.913', '2023-07-07 22:50:00.611');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312072', '43',
'maxBlockMs', 'maxBlockMs', 1, 3, 9,
'{"required":"0","defaultValue":"0","rule":""}', '2023-07-05 14:16:14.236',
'2023-07-07 22:50:00.612');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312073', '43',
'ioThreadCount', 'ioThreadCount', 1, 3, 10,
'{"required":"0","defaultValue":"1","rule":""}', '2023-07-05 14:17:12.065',
'2023-07-07 22:50:00.612');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312074', '43',
'batchSizeThresholdInBytes', 'batchSizeThresholdInBytes', 1, 3, 11,
'{"required":"0","defaultValue":"524288","rule":""}', '2023-07-05
14:18:27.915', '2023-07-07 22:50:00.614');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312075', '43',
'batchCountThreshold', 'batchCountThreshold', 1, 3, 12,
'{"required":"0","defaultValue":"4096","rule":""}', '2023-07-05 14:19:27.704',
'2023-07-07 22:50:00.615');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312076', '43',
'lingerMs', 'lingerMs', 1, 3, 12,
'{"required":"0","defaultValue":"2000","rule":""}', '2023-07-05 14:20:11.908',
'2023-07-07 22:50:00.616');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312077', '43',
'retries', 'retries', 1, 3, 13,
'{"required":"0","defaultValue":"100","rule":""}', '2023-07-05 14:20:50.052',
'2023-07-07 22:50:00.617');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312078', '43',
'baseRetryBackoffMs', 'baseRetryBackoffMs', 1, 3, 14,
'{"required":"0","defaultValue":"100","rule":""}', '2023-07-05 14:22:03.347',
'2023-07-07 22:50:00.618');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312079', '43',
'maxRetryBackoffMs', 'maxRetryBackoffMs', 1, 3, 15,
'{"required":"0","defaultValue":"100","rule":""}', '2023-07-05 14:22:33.010',
'2023-07-07 22:50:00.619');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312080', '43',
'enableLocalTest', 'enableLocalTest', 2, 3, 15,
'{"required":"0","defaultValue":"false","rule":""}', '2023-07-05 14:25:13.500',
'2023-07-07 22:50:00.619');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312081', '43',
'setGiveUpExtraLongSingleLog', 'setGiveUpExtraLongSingleLog', 2, 3, 16,
'{"required":"0","defaultValue":"false","rule":""}', '2023-07-05 14:26:20.600',
'2023-07-07 22:50:00.620');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312082', '43',
'keyword', 'keyword', 2, 2, 0, '{"required":"0","placeholder":"please use ‘;’
to split keyword","rule":""}', '2023-07-05 14:26:20.600', '2023-07-07
22:50:00.620');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312083', '43',
'maskType', 'maskType', 3, 2, 1,
'{"required":"0","defaultValue":"dataMaskByMD5","rule":""}', '2023-07-05
14:26:20.600', '2023-07-07 22:50:00.620');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312084', '43',
'maskStatus', 'maskStatus', 3, 2, 2,
'{"required":"0","defaultValue":"false","rule":""}','2023-07-05 14:26:20.600',
'2023-07-07 22:50:00.620');
-- ----------------------------
-- Table structure for resource
-- ----------------------------
@@ -1724,6 +1757,17 @@ INSERT INTO "public"."resource" VALUES
('1534585531108565050', '1534585531108565
INSERT INTO "public"."resource" VALUES ('1534585531108565051',
'1534585531108565043', 'SHENYU.BUTTON.PLUGIN.RULE.DELETE', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingClickHouseRule:delete', 1, '2022-05-25 18:08:07',
'2022-05-25 18:08:07');
INSERT INTO "public"."resource" VALUES ('1534585531108565052',
'1534585531108565043', 'SHENYU.BUTTON.PLUGIN.SYNCHRONIZE', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingClickHouse:modify', 1, '2022-05-25 18:08:07',
'2022-05-25 18:08:07');
+INSERT INTO "public"."resource" VALUES ('1572525965625266177',
'1346775491550474240', 'loggingHuaweiLts', 'loggingHuaweiLts',
'/plug/loggingHuaweiLts', 'loggingHuaweiLts', 1, 0, 'block', 0, 0, '', 1,
'2023-07-05 14:03:53.699', '2023-07-05 14:03:53.709');
+INSERT INTO "public"."resource" VALUES ('1572525965625266178',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SELECTOR.ADD', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLtsSelector:add', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266179',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SELECTOR.DELETE', '', '', '', 2,
0, '', 1, 0, 'plugin:loggingHuaweiLtsSelector:delete', 1, '2023-07-05
14:03:53.721', '2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266180',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SELECTOR.EDIT', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLtsSelector:edit', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266181',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SELECTOR.QUERY', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLtsSelector:query', 1, '2023-07-05
14:03:53.721', '2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266182',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.RULE.ADD', '', '', '', 2, 0, '',
1, 0, 'plugin:loggingHuaweiLtsRule:add', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266183',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.RULE.DELETE', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLtsRule:delete', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266184',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.RULE.EDIT', '', '', '', 2, 0, '',
1, 0, 'plugin:loggingHuaweiLtsRule:edit', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266185',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.RULE.QUERY', '', '', '', 2, 0, '',
1, 0, 'plugin:loggingHuaweiLtsRule:query', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266186',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SYNCHRONIZE', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLts:modify', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+
INSERT INTO "public"."resource" VALUES ('1572525965625266176',
'1346777449787125760', 'SHENYU.BUTTON.SYSTEM.RESOURCE', '', '', '', 2, 6, '',
1, 0, 'system:plugin:resource', 1, '2022-09-28 11:50:58', '2022-09-28
11:50:58');
-- ----------------------------
-- Table structure for role
diff --git a/db/upgrade/2.5.1-upgrade-2.6.0-mysql.sql
b/db/upgrade/2.5.1-upgrade-2.6.0-mysql.sql
index ffe62ecea..fd85439ad 100644
--- a/db/upgrade/2.5.1-upgrade-2.6.0-mysql.sql
+++ b/db/upgrade/2.5.1-upgrade-2.6.0-mysql.sql
@@ -108,4 +108,49 @@ CREATE TABLE `discovery_rel`
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci
ROW_FORMAT = Dynamic;
-INSERT INTO `plugin` VALUES ('42', 'tcp', NULL, 'Proxy', 320, 1, '2023-05-30
18:02:53', '2022-05-30 18:02:53',null);
\ No newline at end of file
+INSERT INTO `plugin` VALUES ('42', 'tcp', NULL, 'Proxy', 320, 1, '2023-05-30
18:02:53', '2022-05-30 18:02:53',null);
+/* insert plugin data for loggingHuaweiLtsPlugin */
+INSERT INTO `plugin` VALUES ('43', 'loggingHuaweiLts',
'{\"totalSizeInBytes\":\"104857600\",\"maxBlockMs\":\"0\",\"ioThreadCount\":\"1\",\"batchSizeThresholdInBytes\":\"524288\",\"batchCountThreshold\":\"4096\",\"lingerMs\":\"2000\",\"retries\":\"100\",\"baseRetryBackoffMs\":\"100\",\"maxRetryBackoffMs\":\"100\",\"enableLocalTest\":\"true\",\"setGiveUpExtraLongSingleLog\":\"false\"}',
'Logging', 177, 0, '2023-07-05 14:03:53.686', '2023-07-06 12:42:07.234', NULL);
+/* insert permission data for loggingHuaweiLtsPlugin */
+INSERT INTO `permission` VALUES ('1572525965658820609', '1346358560427216896',
'1676471945048780800', '2023-07-07 23:20:04.962', '2023-07-07 23:20:14.170');
+INSERT INTO `permission` VALUES ('1572525965658820610', '1346358560427216896',
'1676471945124278272', '2023-07-07 23:21:23.648', '2023-07-07 23:21:23.648');
+INSERT INTO `permission` VALUES ('1572525965658820611', '1346358560427216896',
'1676471945124278273', '2023-07-07 23:23:40.409', '2023-07-07 23:23:40.409');
+INSERT INTO `permission` VALUES ('1572525965658820612', '1346358560427216896',
'1676471945124278274', '2023-07-07 23:24:03.398', '2023-07-07 23:24:03.398');
+INSERT INTO `permission` VALUES ('1572525965658820613', '1346358560427216896',
'1676471945124278275', '2023-07-07 23:24:19.165', '2023-07-07 23:24:19.165');
+INSERT INTO `permission` VALUES ('1572525965658820614', '1346358560427216896',
'1676471945124278276', '2023-07-07 23:24:52.339', '2023-07-07 23:24:52.339');
+INSERT INTO `permission` VALUES ('1572525965658820615', '1346358560427216896',
'1676471945124278277', '2023-07-07 23:25:30.528', '2023-07-07 23:25:30.528');
+INSERT INTO `permission` VALUES ('1572525965658820616', '1346358560427216896',
'1676471945124278278', '2023-07-07 23:25:50.772', '2023-07-07 23:25:50.772');
+INSERT INTO `permission` VALUES ('1572525965658820617', '1346358560427216896',
'1676471945124278279', '2023-07-07 23:26:11.518', '2023-07-07 23:26:11.518');
+INSERT INTO `permission` VALUES ('1572525965658820618', '1346358560427216896',
'1676471945124278280', '2023-07-07 23:26:37.388', '2023-07-07 23:26:37.388');
+/* insert plugin_handle data for loggingHuaweiLtsPlugin */
+INSERT INTO `plugin_handle` VALUES ('1676472478492946432', '43', 'projectId',
'projectId', 2, 3, 0, '{\"required\":\"1\",\"rule\":\"\"}', '2023-07-05
14:06:00.893', '2023-07-07 22:50:00.597');
+INSERT INTO `plugin_handle` VALUES ('1676473313352380416', '43', 'logGroupId',
'logGroupId', 2, 3, 1, '{\"required\":\"1\",\"rule\":\"\"}', '2023-07-05
14:09:19.928', '2023-07-07 22:50:00.606');
+INSERT INTO `plugin_handle` VALUES ('1676473453001732096', '43',
'logStreamId', 'logStreamId', 2, 3, 2, '{\"required\":\"1\",\"rule\":\"\"}',
'2023-07-05 14:09:53.224', '2023-07-07 22:50:00.607');
+INSERT INTO `plugin_handle` VALUES ('1676473657121730560', '43',
'accessKeyId', 'AccessKey', 2, 3, 4, '{\"required\":\"1\",\"rule\":\"\"}',
'2023-07-05 14:10:41.897', '2023-07-07 22:50:00.608');
+INSERT INTO `plugin_handle` VALUES ('1676474055324758016', '43',
'accessKeySecret', 'accessKey', 2, 3, 5, '{\"required\":\"1\",\"rule\":\"\"}',
'2023-07-05 14:12:16.828', '2023-07-07 22:50:00.609');
+INSERT INTO `plugin_handle` VALUES ('1676474340008947712', '43', 'regionName',
'regionName', 2, 3, 6, '{\"required\":\"1\",\"rule\":\"\"}', '2023-07-05
14:13:24.703', '2023-07-07 22:50:00.610');
+INSERT INTO `plugin_handle` VALUES ('1676474810655993856', '43',
'totalSizeInBytes', 'totalSizeInBytes', 1, 3, 8,
'{\"required\":\"0\",\"defaultValue\":\"104857600\",\"rule\":\"\"}',
'2023-07-05 14:15:16.913', '2023-07-07 22:50:00.611');
+INSERT INTO `plugin_handle` VALUES ('1676475051081887744', '43', 'maxBlockMs',
'maxBlockMs', 1, 3, 9,
'{\"required\":\"0\",\"defaultValue\":\"0\",\"rule\":\"\"}', '2023-07-05
14:16:14.236', '2023-07-07 22:50:00.612');
+INSERT INTO `plugin_handle` VALUES ('1676475293634293760', '43',
'ioThreadCount', 'ioThreadCount', 1, 3, 10,
'{\"required\":\"0\",\"defaultValue\":\"1\",\"rule\":\"\"}', '2023-07-05
14:17:12.065', '2023-07-07 22:50:00.612');
+INSERT INTO `plugin_handle` VALUES ('1676475611772252160', '43',
'batchSizeThresholdInBytes', 'batchSizeThresholdInBytes', 1, 3, 11,
'{\"required\":\"0\",\"defaultValue\":\"524288\",\"rule\":\"\"}', '2023-07-05
14:18:27.915', '2023-07-07 22:50:00.614');
+INSERT INTO `plugin_handle` VALUES ('1676475862545494016', '43',
'batchCountThreshold', 'batchCountThreshold', 1, 3, 12,
'{\"required\":\"0\",\"defaultValue\":\"4096\",\"rule\":\"\"}', '2023-07-05
14:19:27.704', '2023-07-07 22:50:00.615');
+INSERT INTO `plugin_handle` VALUES ('1676476047950508032', '43', 'lingerMs',
'lingerMs', 1, 3, 12,
'{\"required\":\"0\",\"defaultValue\":\"2000\",\"rule\":\"\"}', '2023-07-05
14:20:11.908', '2023-07-07 22:50:00.616');
+INSERT INTO `plugin_handle` VALUES ('1676476207938039808', '43', 'retries',
'retries', 1, 3, 13,
'{\"required\":\"0\",\"defaultValue\":\"100\",\"rule\":\"\"}', '2023-07-05
14:20:50.052', '2023-07-07 22:50:00.617');
+INSERT INTO `plugin_handle` VALUES ('1676476515359551488', '43',
'baseRetryBackoffMs', 'baseRetryBackoffMs', 1, 3, 14,
'{\"required\":\"0\",\"defaultValue\":\"100\",\"rule\":\"\"}', '2023-07-05
14:22:03.347', '2023-07-07 22:50:00.618');
+INSERT INTO `plugin_handle` VALUES ('1676476639779385344', '43',
'maxRetryBackoffMs', 'maxRetryBackoffMs', 1, 3, 15,
'{\"required\":\"0\",\"defaultValue\":\"100\",\"rule\":\"\"}', '2023-07-05
14:22:33.010', '2023-07-07 22:50:00.619');
+INSERT INTO `plugin_handle` VALUES ('1676477312923234304', '43',
'enableLocalTest', 'enableLocalTest', 2, 3, 15,
'{\"required\":\"0\",\"defaultValue\":\"false\",\"rule\":\"\"}', '2023-07-05
14:25:13.500', '2023-07-07 22:50:00.619');
+INSERT INTO `plugin_handle` VALUES ('1676477594361032704', '43',
'setGiveUpExtraLongSingleLog', 'setGiveUpExtraLongSingleLog', 2, 3, 16,
'{\"required\":\"0\",\"defaultValue\":\"false\",\"rule\":\"\"}', '2023-07-05
14:26:20.600', '2023-07-07 22:50:00.620');
+INSERT INTO `plugin_handle` VALUES ('1676477594361032705', '43', 'keyword',
'keyword', 2, 2, 0, '{\"required\":\"0\",\"placeholder\":\"please use ‘;’ to
split keyword\",\"rule\":\"\"}', '2023-07-05 14:26:20.600', '2023-07-07
22:50:00.620');
+INSERT INTO `plugin_handle` VALUES ('1676477594361032706', '43', 'maskType',
'maskType', 3, 2, 1,
'{\"required\":\"0\",\"defaultValue\":\"dataMaskByMD5\",\"rule\":\"\"}',
'2023-07-05 14:26:20.600', '2023-07-07 22:50:00.620');
+INSERT INTO `plugin_handle` VALUES ('1676477594361032707', '43', 'maskStatus',
'maskStatus', 3, 2, 2,
'{\"required\":\"0\",\"defaultValue\":\"false\",\"rule\":\"\"}','2023-07-05
14:26:20.600', '2023-07-07 22:50:00.620');
+/* insert resource data for loggingHuaweiLtsPlugin */
+INSERT INTO `resource` VALUES ('1676471945048780800', '1346775491550474240',
'loggingHuaweiLts', 'loggingHuaweiLts', '/plug/loggingHuaweiLts',
'loggingHuaweiLts', 1, 0, 'block', 0, 0, '', 1, '2023-07-05 14:03:53.699',
'2023-07-05 14:03:53.709');
+INSERT INTO `resource` VALUES ('1676471945124278272', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SELECTOR.ADD', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:add', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278273', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SELECTOR.DELETE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:delete', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278274', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SELECTOR.EDIT', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:edit', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278275', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SELECTOR.QUERY', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:query', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278276', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.RULE.ADD', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:add', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278277', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.RULE.DELETE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:delete', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278278', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.RULE.EDIT', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:edit', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278279', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.RULE.QUERY', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:query', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
+INSERT INTO `resource` VALUES ('1676471945124278280', '1676471945048780800',
'SHENYU.BUTTON.PLUGIN.SYNCHRONIZE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLts:modify', 1, '2023-07-05 14:03:53.721', '2023-07-05
14:03:53.721');
diff --git a/db/upgrade/2.5.1-upgrade-2.6.0-oracle.sql
b/db/upgrade/2.5.1-upgrade-2.6.0-oracle.sql
index 4461c998f..f1d885d2f 100644
--- a/db/upgrade/2.5.1-upgrade-2.6.0-oracle.sql
+++ b/db/upgrade/2.5.1-upgrade-2.6.0-oracle.sql
@@ -204,3 +204,67 @@ comment on column PROXY_SELECTOR.date_updated
INSERT INTO `plugin` VALUES ('42', 'tcp', NULL, 'Proxy', 320, 1, '2023-05-30
18:02:53', '2022-05-30 18:02:53',null);
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin(id)) */ INTO plugin (id, name,
role, sort, config, enabled, plugin_jar) VALUES ('42', 'tcp', 'Proxy', 320,
null, '1', null);
+
+INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin(id)) */ INTO plugin (id, name,
role, sort, config, enabled) VALUES ('43', 'loggingHuaweiLts', 'Logging', 177,
'{"totalSizeInBytes":"104857600","maxBlockMs":"0","ioThreadCount":"1","batchSizeThresholdInBytes":"524288","batchCountThreshold":"4096","lingerMs":"2000","retries":"100","baseRetryBackoffMs":"100","maxRetryBackoffMs":"100","enableLocalTest":"true","setGiveUpExtraLongSingleLog":"false"}','0');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172863', '43', 'projectId', 'projectId', 2, 3, 0,
'{"required":"1","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172864', '43', 'logGroupId', 'logGroupId', 2, 3, 1,
'{"required":"1","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172865', '43', 'logStreamId', 'logStreamId', 2, 3, 2,
'{"required":"1","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172866', '43', 'accessKeyId', 'AccessKey', 2, 3, 4,
'{"required":"1","placeholder":"accessKeyId","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172867', '43','accessKeySecret', 'accessKey', 2, 3, 5,
'{"required":"1","placeholder":"accessKeySecret","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172868', '43', 'regionName', 'regionName', 2, 3, 6,
'{"required":"1","placeholder":"regionName","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172869', '43', 'totalSizeInBytes', 'totalSizeInBytes',
1, 3, 8,
'{"required":"0","defaultValue":"104857600","placeholder":"totalSizeInBytes","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172870', '43', 'maxBlockMs', 'maxBlockMs', 1, 3, 9,
'{"required":"0","defaultValue":"0","placeholder":"maxBlockMs","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172871', '43', 'ioThreadCount', 'ioThreadCount', 1, 3,
10,
'{"required":"0","defaultValue":"1","placeholder":"ioThreadCount","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172872', '43', 'batchSizeThresholdInBytes',
'batchSizeThresholdInBytes', 1, 3, 11,
'{"required":"0","defaultValue":"524288","placeholder":"
batchSizeThresholdInBytes","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172873', '43', 'batchCountThreshold',
'batchCountThreshold', 1, 3, 12,
'{"required":"0","defaultValue":"4096","placeholder":"
batchCountThreshold","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172874', '43', 'lingerMs', 'lingerMs', 1, 3, 12,
'{"required":"0","defaultValue":"2000","placeholder":"lingerMs","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172875', '43', 'retries', 'retries', 1, 3, 13,
'{"required":"0","defaultValue":"100","placeholder":"retries","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172876', '43', 'baseRetryBackoffMs',
'baseRetryBackoffMs', 1, 3, 14,
'{"required":"0","defaultValue":"100","placeholder":"baseRetryBackoffMs","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172877', '43', 'maxRetryBackoffMs', 'maxRetryBackoffMs',
1, 3, 15,
'{"required":"0","defaultValue":"100","placeholder":"maxRetryBackoffMs","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172878', '43', 'enableLocalTest', 'enableLocalTest', 2,
3, 15,
'{"required":"0","defaultValue":"false","placeholder":"enableLocalTest","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+VALUES ('1529402613204172879', '43', 'setGiveUpExtraLongSingleLog',
'setGiveUpExtraLongSingleLog', 2, 3, 16,
'{"required":"0","defaultValue":"false","placeholder":"setGiveUpExtraLongSingleLog","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+values ('1529402613204172880', '43', 'maskStatus', 'maskStatus', 3, 2, 2,
'{"required":"0","defaultValue":"false","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+values ('1529402613204172881', '43', 'keyword', 'keyword', 2, 2, 0,
'{"required":"0","placeholder":"please use ‘;’ to split keyword","rule":""}');
+
+insert /*+ IGNORE_ROW_ON_DUPKEY_INDEX(plugin_handle(plugin_id, field, type))
*/ into plugin_handle (ID, PLUGIN_ID, FIELD, LABEL, DATA_TYPE, TYPE, SORT,
EXT_OBJ)
+values ('1529402613204172882', '43', 'maskType', 'maskType', 3, 2, 1,
'{"required":"0","defaultValue":"dataMaskByMD5","rule":""}');
+
+
diff --git a/db/upgrade/2.5.1-upgrade-2.6.0-pg.sql
b/db/upgrade/2.5.1-upgrade-2.6.0-pg.sql
index d61fae95c..8fec37f70 100644
--- a/db/upgrade/2.5.1-upgrade-2.6.0-pg.sql
+++ b/db/upgrade/2.5.1-upgrade-2.6.0-pg.sql
@@ -121,4 +121,49 @@ COMMENT ON COLUMN "public"."proxy_selector"."date_created"
IS 'create time';
COMMENT ON COLUMN "public"."proxy_selector"."date_updated" IS 'update time';
-INSERT INTO "public"."plugin" VALUES ('42', 'tcp', null, 'Proxy', 320, 1,
'2022-05-25 18:08:01', '2022-05-25 18:08:01', null);
\ No newline at end of file
+INSERT INTO "public"."plugin" VALUES ('42', 'tcp', null, 'Proxy', 320, 1,
'2022-05-25 18:08:01', '2022-05-25 18:08:01', null);
+INSERT INTO "public"."plugin" VALUES ('43', 'loggingHuaweiLts', '{
"totalSizeInBytes":
"104857600","maxBlockMs":"0","ioThreadCount":"1","batchSizeThresholdInBytes":"524288","batchCountThreshold":"4096","lingerMs":"2000","retries":"100","baseRetryBackoffMs":"100","maxRetryBackoffMs":"100","enableLocalTest":"true","setGiveUpExtraLongSingleLog":"false"}',
'Logging', 177, 0, '2023-07-05 14:03:53', '2023-07-06 12:42:07', null);
+
+INSERT INTO "public"."permission" VALUES ('1572525965658820609',
'1346358560427216896', '1572525965625266177', '2023-07-07 23:20:04.962',
'2023-07-07 23:20:14.170');
+INSERT INTO "public"."permission" VALUES ('1572525965658820610',
'1346358560427216896', '1572525965625266178', '2023-07-07 23:21:23.648',
'2023-07-07 23:21:23.648');
+INSERT INTO "public"."permission" VALUES ('1572525965658820611',
'1346358560427216896', '1572525965625266179', '2023-07-07 23:23:40.409',
'2023-07-07 23:23:40.409');
+INSERT INTO "public"."permission" VALUES ('1572525965658820612',
'1346358560427216896', '1572525965625266180', '2023-07-07 23:24:03.398',
'2023-07-07 23:24:03.398');
+INSERT INTO "public"."permission" VALUES ('1572525965658820613',
'1346358560427216896', '1572525965625266181', '2023-07-07 23:24:19.165',
'2023-07-07 23:24:19.165');
+INSERT INTO "public"."permission" VALUES ('1572525965658820614',
'1346358560427216896', '1572525965625266182', '2023-07-07 23:24:52.339',
'2023-07-07 23:24:52.339');
+INSERT INTO "public"."permission" VALUES ('1572525965658820615',
'1346358560427216896', '1572525965625266183', '2023-07-07 23:25:30.528',
'2023-07-07 23:25:30.528');
+INSERT INTO "public"."permission" VALUES ('1572525965658820616',
'1346358560427216896', '1572525965625266184', '2023-07-07 23:25:50.772',
'2023-07-07 23:25:50.772');
+INSERT INTO "public"."permission" VALUES ('1572525965658820617',
'1346358560427216896', '1572525965625266185', '2023-07-07 23:26:11.518',
'2023-07-07 23:26:11.518');
+INSERT INTO "public"."permission" VALUES ('1572525965658820618',
'1346358560427216896', '1572525965625266186', '2023-07-07 23:26:37.388',
'2023-07-07 23:26:37.388');
+
+
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312065', '43',
'projectId', 'projectId', 2, 3, 0, '{"required":"1","rule":""}', '2023-07-05
14:06:00.893', '2023-07-07 22:50:00.597');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312066', '43',
'logGroupId', 'logGroupId', 2, 3, 1, '{"required":"1","rule":""}', '2023-07-05
14:09:19.928', '2023-07-07 22:50:00.606');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312067', '43',
'logStreamId', 'logStreamId', 2, 3, 2, '{"required":"1","rule":""}',
'2023-07-05 14:09:53.224', '2023-07-07 22:50:00.607');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312068', '43',
'accessKeyId', 'AccessKey', 2, 3, 4, '{"required":"1","rule":""}', '2023-07-05
14:10:41.897', '2023-07-07 22:50:00.608');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312069', '43',
'accessKeySecret', 'accessKey', 2, 3, 5, '{"required":"1","rule":""}',
'2023-07-05 14:12:16.828', '2023-07-07 22:50:00.609');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312070', '43',
'regionName', 'regionName', 2, 3, 6, '{"required":"1","rule":""}', '2023-07-05
14:13:24.703', '2023-07-07 22:50:00.610');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312071', '43',
'totalSizeInBytes', 'totalSizeInBytes', 1, 3, 8,
'{"required":"0","defaultValue":"104857600","rule":""}', '2023-07-05
14:15:16.913', '2023-07-07 22:50:00.611');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312072', '43',
'maxBlockMs', 'maxBlockMs', 1, 3, 9,
'{"required":"0","defaultValue":"0","rule":""}', '2023-07-05 14:16:14.236',
'2023-07-07 22:50:00.612');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312073', '43',
'ioThreadCount', 'ioThreadCount', 1, 3, 10,
'{"required":"0","defaultValue":"1","rule":""}', '2023-07-05 14:17:12.065',
'2023-07-07 22:50:00.612');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312074', '43',
'batchSizeThresholdInBytes', 'batchSizeThresholdInBytes', 1, 3, 11,
'{"required":"0","defaultValue":"524288","rule":""}', '2023-07-05
14:18:27.915', '2023-07-07 22:50:00.614');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312075', '43',
'batchCountThreshold', 'batchCountThreshold', 1, 3, 12,
'{"required":"0","defaultValue":"4096","rule":""}', '2023-07-05 14:19:27.704',
'2023-07-07 22:50:00.615');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312076', '43',
'lingerMs', 'lingerMs', 1, 3, 12,
'{"required":"0","defaultValue":"2000","rule":""}', '2023-07-05 14:20:11.908',
'2023-07-07 22:50:00.616');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312077', '43',
'retries', 'retries', 1, 3, 13,
'{"required":"0","defaultValue":"100","rule":""}', '2023-07-05 14:20:50.052',
'2023-07-07 22:50:00.617');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312078', '43',
'baseRetryBackoffMs', 'baseRetryBackoffMs', 1, 3, 14,
'{"required":"0","defaultValue":"100","rule":""}', '2023-07-05 14:22:03.347',
'2023-07-07 22:50:00.618');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312079', '43',
'maxRetryBackoffMs', 'maxRetryBackoffMs', 1, 3, 15,
'{"required":"0","defaultValue":"100","rule":""}', '2023-07-05 14:22:33.010',
'2023-07-07 22:50:00.619');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312080', '43',
'enableLocalTest', 'enableLocalTest', 2, 3, 15,
'{"required":"0","defaultValue":"false","rule":""}', '2023-07-05 14:25:13.500',
'2023-07-07 22:50:00.619');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312081', '43',
'setGiveUpExtraLongSingleLog', 'setGiveUpExtraLongSingleLog', 2, 3, 16,
'{"required":"0","defaultValue":"false","rule":""}', '2023-07-05 14:26:20.600',
'2023-07-07 22:50:00.620');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312082', '43',
'keyword', 'keyword', 2, 2, 0, '{"required":"0","placeholder":"please use ‘;’
to split keyword","rule":""}', '2023-07-05 14:26:20.600', '2023-07-07
22:50:00.620');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312083', '43',
'maskType', 'maskType', 3, 2, 1,
'{"required":"0","defaultValue":"dataMaskByMD5","rule":""}', '2023-07-05
14:26:20.600', '2023-07-07 22:50:00.620');
+INSERT INTO "public"."plugin_handle" VALUES ('1570591265492312084', '43',
'maskStatus', 'maskStatus', 3, 2, 2,
'{"required":"0","defaultValue":"false","rule":""}','2023-07-05 14:26:20.600',
'2023-07-07 22:50:00.620');
+
+INSERT INTO "public"."resource" VALUES ('1572525965625266177',
'1346775491550474240', 'loggingHuaweiLts', 'loggingHuaweiLts',
'/plug/loggingHuaweiLts', 'loggingHuaweiLts', 1, 0, 'block', 0, 0, '', 1,
'2023-07-05 14:03:53.699', '2023-07-05 14:03:53.709');
+INSERT INTO "public"."resource" VALUES ('1572525965625266178',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SELECTOR.ADD', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLtsSelector:add', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266179',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SELECTOR.DELETE', '', '', '', 2,
0, '', 1, 0, 'plugin:loggingHuaweiLtsSelector:delete', 1, '2023-07-05
14:03:53.721', '2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266180',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SELECTOR.EDIT', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLtsSelector:edit', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266181',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SELECTOR.QUERY', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLtsSelector:query', 1, '2023-07-05
14:03:53.721', '2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266182',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.RULE.ADD', '', '', '', 2, 0, '',
1, 0, 'plugin:loggingHuaweiLtsRule:add', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266183',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.RULE.DELETE', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLtsRule:delete', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266184',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.RULE.EDIT', '', '', '', 2, 0, '',
1, 0, 'plugin:loggingHuaweiLtsRule:edit', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266185',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.RULE.QUERY', '', '', '', 2, 0, '',
1, 0, 'plugin:loggingHuaweiLtsRule:query', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
+INSERT INTO "public"."resource" VALUES ('1572525965625266186',
'1572525965625266177', 'SHENYU.BUTTON.PLUGIN.SYNCHRONIZE', '', '', '', 2, 0,
'', 1, 0, 'plugin:loggingHuaweiLts:modify', 1, '2023-07-05 14:03:53.721',
'2023-07-05 14:03:53.721');
diff --git a/pom.xml b/pom.xml
index 71f5d08f2..843001756 100644
--- a/pom.xml
+++ b/pom.xml
@@ -176,9 +176,10 @@
<lettuce.version>6.1.2.RELEASE</lettuce.version>
<protobuf-java.version>3.19.6</protobuf-java.version>
<aliyun-log-producer.version>0.3.10</aliyun-log-producer.version>
- <tencent-log-sdk.version>1.0.9</tencent-log-sdk.version>
+ <tencent-log-sdk.version>1.0.14</tencent-log-sdk.version>
<jsonpath.version>2.4.0</jsonpath.version>
<casdoor-java-sdk.version>1.9.0</casdoor-java-sdk.version>
+ <huawei-log-sdk.version>1.0.1</huawei-log-sdk.version>
</properties>
<dependencyManagement>
diff --git a/shenyu-admin/src/main/resources/sql-script/h2/schema.sql
b/shenyu-admin/src/main/resources/sql-script/h2/schema.sql
index 97e5692ac..21f39b3e7 100755
--- a/shenyu-admin/src/main/resources/sql-script/h2/schema.sql
+++ b/shenyu-admin/src/main/resources/sql-script/h2/schema.sql
@@ -546,6 +546,7 @@ INSERT IGNORE INTO `plugin` (`id`, `name`, `role`, `sort`,
`config`, `enabled`)
INSERT IGNORE INTO `plugin` (`id`, `name`, `role`, `sort`, `enabled`) VALUES
('40', 'keyAuth', 'Authentication', 150, '0');
INSERT IGNORE INTO `plugin` (`id`, `name`, `role`, `sort`, `config`,
`enabled`) VALUES ('41', 'brpc', 'Proxy',
310,'{"address":"127.0.0.1","port":"8005","corethreads":0,"threads":2147483647,"queues":0,"threadpool":"shared"}','0');
INSERT IGNORE INTO `plugin` (`id`, `name`, `role`, `sort`, `enabled`) VALUES
('42','tcp','Proxy', 320, '1');
+INSERT IGNORE INTO `plugin` (`id`, `name`, `role`, `sort`, `config`,
`enabled`) VALUES ('43', 'loggingHuaweiLts', 'Logging', 177, '{
"totalSizeInBytes":"104857600","maxBlockMs":"0","ioThreadCount":"1","batchSizeThresholdInBytes":"524288","batchCountThreshold":"4096","lingerMs":"2000","retries":"100","baseRetryBackoffMs":"100","maxRetryBackoffMs":"100","enableLocalTest":"true","setGiveUpExtraLongSingleLog":"false"}',
'0');
/*insert plugin_handle data for sentinel*/
INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1529402613195784246', '10', 'flowRuleGrade', 'flowRuleGrade', 3, 2, 8,
'{"required":"1","defaultValue":"1","rule":""}');
@@ -827,6 +828,28 @@ INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,
INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1529402613204172960', '41', 'threads', 'threads', 1, 3, 0,
'{"required":"0","defaultValue":"2147483647","placeholder":"threads","rule":""}');
INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1529402613204172961', '41', 'queues', 'queues', 1, 3, 0,
'{"required":"0","defaultValue":"0","placeholder":"queues","rule":""}');
INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1529402613204172962', '41', 'threadpool', 'threadpool', 3, 3, 0,
'{"required":"0","defaultValue":"shared","placeholder":"threadpool","rule":""}');
+
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312065', '43', 'projectId', 'projectId', 2, 3, 0,
'{"required":"1","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312066', '43', 'logGroupId', 'logGroupId', 2, 3, 1,
'{"required":"1","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312067', '43', 'logStreamId', 'logStreamId', 2, 3, 2,
'{"required":"1","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312068', '43', 'accessKeyId', 'AccessKey', 2, 3, 4,
'{"required":"1","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312069', '43', 'accessKeySecret', 'accessKey', 2, 3, 5,
'{"required":"1","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312070', '43', 'regionName', 'regionName', 2, 3, 6,
'{"required":"1","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312071', '43', 'totalSizeInBytes', 'totalSizeInBytes', 1, 3, 8,
'{"required":"0","defaultValue":"104857600","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312072', '43', 'maxBlockMs', 'maxBlockMs', 1, 3, 9,
'{"required":"0","defaultValue":"0","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312073', '43', 'ioThreadCount', 'ioThreadCount', 1, 3, 10,
'{"required":"0","defaultValue":"1","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312074', '43', 'batchSizeThresholdInBytes',
'batchSizeThresholdInBytes', 1, 3, 11,
'{"required":"0","defaultValue":"524388","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312075', '43', 'batchCountThreshold', 'batchCountThreshold', 1,
3, 12, '{"required":"0","defaultValue":"4096","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312076', '43', 'lingerMs', 'lingerMs', 1, 3, 12,
'{"required":"0","defaultValue":"2000","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312077', '43', 'retries', 'retries', 1, 3, 13,
'{"required":"0","defaultValue":"100","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312078', '43', 'baseRetryBackoffMs', 'baseRetryBackoffMs', 1, 3,
14, '{"required":"0","defaultValue":"100","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312079', '43', 'maxRetryBackoffMs', 'maxRetryBackoffMs', 1, 3,
15, '{"required":"0","defaultValue":"100","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312080', '43', 'enableLocalTest', 'enableLocalTest', 2, 3, 15,
'{"required":"0","defaultValue":"false","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312081', '43', 'setGiveUpExtraLongSingleLog',
'setGiveUpExtraLongSingleLog', 2, 3, 16,
'{"required":"0","defaultValue":"false","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312082', '43', 'keyword', 'keyword', 2, 2, 0,
'{"required":"0","placeholder":"please use ‘;’ to split keyword","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312083', '43', 'maskType', 'maskType', 3, 2, 1,
'{"required":"0","defaultValue":"dataMaskByMD5","rule":""}');
+INSERT IGNORE INTO plugin_handle (`id`,
`plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES
('1570591265492312084', '43', 'maskStatus', 'maskStatus', 3, 2, 2,
'{"required":"0","defaultValue":"false","rule":""}');
+
/** insert resource for resource */
INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`)
VALUES('1346775491550474240','','SHENYU.MENU.PLUGIN.LIST','plug','/plug','PluginList','0','0','dashboard','0','0','','1');
@@ -896,6 +919,16 @@ INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`,
`name`, `url`, `compo
INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1534585430311051264', '1534577121923309568',
'SHENYU.MENU.DOCUMENT.APIDOC', '', '/document/apidoc', '', 1, 0, 'api', 0, 0,
'', 1);
INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1534585531108564992', '1534585430311051264', 'send', '', '',
'', 2, 0, '', 1, 0, 'document:apirun:send', 1);
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266177', '1346776175553376256',
'loggingHuaweiLts', 'loggingHuaweiLts', '/plug/loggingHuaweiLts',
'loggingHuaweiLts', 1, 0, 'block', 0, 0, '', '1' );
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266178', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.SELECTOR.ADD', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:add', '1' );
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266179', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.SELECTOR.DELETE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:delete', '1' );
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266180', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.SELECTOR.EDIT', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:edit', '1');
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266181', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.SELECTOR.QUERY', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsSelector:query', '1');
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266182', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.RULE.ADD', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:add', '1');
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266183', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.RULE.DELETE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:delete', '1');
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266184', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.RULE.EDIT', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:edit', '1');
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266185', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.RULE.QUERY', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLtsRule:query', '1');
+INSERT IGNORE INTO `resource` (`id`, `parent_id`, `title`, `name`, `url`,
`component`, `resource_type`, `sort`, `icon`, `is_leaf`, `is_route`, `perms`,
`status`) VALUES ('1572525965625266186', '1572525965625266177',
'SHENYU.BUTTON.PLUGIN.SYNCHRONIZE', '', '', '', 2, 0, '', 1, 0,
'plugin:loggingHuaweiLts:modify', '1');
@@ -961,6 +994,17 @@ INSERT IGNORE INTO `permission` (`id`, `object_id`,
`resource_id`) VALUES ('1534
INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1534585430587875328', '1346358560427216896', '1534585430311051264');
INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1534585531389583360', '1346358560427216896', '1534585531108564992');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820609', '1346358560427216896', '1572525965625266177');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820610', '1346358560427216896', '1572525965625266178');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820611', '1346358560427216896', '1572525965625266179');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820612', '1346358560427216896', '1572525965625266180');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820613', '1346358560427216896', '1572525965625266181');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820614', '1346358560427216896', '1572525965625266182');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820615', '1346358560427216896', '1572525965625266183');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820616', '1346358560427216896', '1572525965625266184');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820617', '1346358560427216896', '1572525965625266185');
+INSERT IGNORE INTO `permission` (`id`, `object_id`, `resource_id`) VALUES
('1572525965658820618', '1346358560427216896', '1572525965625266186');
+
-- ----------------------------
-- Table structure for tag
-- ----------------------------
diff --git a/shenyu-bootstrap/pom.xml b/shenyu-bootstrap/pom.xml
index 462b65520..05fd08b5f 100644
--- a/shenyu-bootstrap/pom.xml
+++ b/shenyu-bootstrap/pom.xml
@@ -563,6 +563,15 @@
</dependency>
<!-- shenyu logging-tencentcls plugin end -->
+ <!-- shenyu logging-huaweilts plugin start -->
+ <dependency>
+ <groupId>org.apache.shenyu</groupId>
+
<artifactId>shenyu-spring-boot-starter-plugin-logging-huawei-lts</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <!-- shenyu logging-huaweilts plugin end -->
+
+
<!-- shenyu logging-clickhouse plugin start -->
<dependency>
<groupId>org.apache.shenyu</groupId>
@@ -571,6 +580,7 @@
</dependency>
<!-- shenyu logging-clickhouse plugin end -->
+
<!-- shenyu brpc plugin start -->
<dependency>
<groupId>org.apache.shenyu</groupId>
diff --git
a/shenyu-common/src/main/java/org/apache/shenyu/common/enums/PluginEnum.java
b/shenyu-common/src/main/java/org/apache/shenyu/common/enums/PluginEnum.java
index 7a9b38784..bfdf11e10 100644
--- a/shenyu-common/src/main/java/org/apache/shenyu/common/enums/PluginEnum.java
+++ b/shenyu-common/src/main/java/org/apache/shenyu/common/enums/PluginEnum.java
@@ -157,6 +157,11 @@ public enum PluginEnum {
*/
LOGGING_TENCENT_CLS(176, 0, "loggingTencentCls"),
+ /**
+ * Logging Huawei lts enums.
+ */
+ LOGGING_HUAWEI_LTS(177, 0, "loggingHuaweiLts"),
+
/**
* Logging Kafka plugin enum.
*/
diff --git a/shenyu-dist/shenyu-bootstrap-dist/src/main/release-docs/LICENSE
b/shenyu-dist/shenyu-bootstrap-dist/src/main/release-docs/LICENSE
index 6f7a2e08c..c9ddc2136 100644
--- a/shenyu-dist/shenyu-bootstrap-dist/src/main/release-docs/LICENSE
+++ b/shenyu-dist/shenyu-bootstrap-dist/src/main/release-docs/LICENSE
@@ -560,7 +560,7 @@ The text of each license is the standard Apache 2.0 license.
client-java-spring-integration 17.0.2:
https://github.com/kubernetes-client/java, Apache 2.0
kotlin-stdlib 1.6.21 https://kotlinlang.org, Apache 2.0
kotlin-stdlib-common 1.6.21 https://kotlinlang.org, Apache 2.0
-
+ lts-sdk-java 1.0.1:
https://github.com/huaweicloud/huaweicloud-lts-sdk-java, Apache 2.0
========================================================================
BSD licenses
========================================================================
diff --git a/shenyu-plugin/shenyu-plugin-logging/pom.xml
b/shenyu-plugin/shenyu-plugin-logging/pom.xml
index 01d3428c5..e487795be 100644
--- a/shenyu-plugin/shenyu-plugin-logging/pom.xml
+++ b/shenyu-plugin/shenyu-plugin-logging/pom.xml
@@ -37,6 +37,7 @@
<module>shenyu-plugin-logging-tencent-cls</module>
<module>shenyu-plugin-logging-clickhouse</module>
<module>shenyu-plugin-logging-desensitize-api</module>
+ <module>shenyu-plugin-logging-huawei-lts</module>
</modules>
<dependencies>
diff --git a/shenyu-plugin/shenyu-plugin-logging/pom.xml
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/pom.xml
similarity index 54%
copy from shenyu-plugin/shenyu-plugin-logging/pom.xml
copy to
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/pom.xml
index 01d3428c5..fa600be6d 100644
--- a/shenyu-plugin/shenyu-plugin-logging/pom.xml
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/pom.xml
@@ -16,34 +16,38 @@
~ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
+ <artifactId>shenyu-plugin-logging</artifactId>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-plugin</artifactId>
<version>2.6.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-plugin-logging</artifactId>
- <packaging>pom</packaging>
- <modules>
- <module>shenyu-plugin-logging-common</module>
- <module>shenyu-plugin-logging-console</module>
- <module>shenyu-plugin-logging-rocketmq</module>
- <module>shenyu-plugin-logging-kafka</module>
- <module>shenyu-plugin-logging-elasticsearch</module>
- <module>shenyu-plugin-logging-aliyun-sls</module>
- <module>shenyu-plugin-logging-pulsar</module>
- <module>shenyu-plugin-logging-tencent-cls</module>
- <module>shenyu-plugin-logging-clickhouse</module>
- <module>shenyu-plugin-logging-desensitize-api</module>
- </modules>
+ <artifactId>shenyu-plugin-logging-huawei-lts</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-plugin-base</artifactId>
+ <artifactId>shenyu-plugin-logging-common</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>io.github.huaweicloud</groupId>
+ <artifactId>lts-sdk-java</artifactId>
+ <version>${huawei-log-sdk.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/LoggingHuaweiLtsPlugin.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/LoggingHuaweiLtsPlugin.java
new file mode 100644
index 000000000..336c47dde
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/LoggingHuaweiLtsPlugin.java
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts;
+
+import org.apache.shenyu.common.dto.RuleData;
+import org.apache.shenyu.common.dto.SelectorData;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.plugin.huawei.lts.collector.HuaweiLtsLogCollector;
+import org.apache.shenyu.plugin.logging.common.AbstractLoggingPlugin;
+import org.apache.shenyu.plugin.logging.common.collector.LogCollector;
+import org.apache.shenyu.plugin.logging.common.entity.ShenyuRequestLog;
+import org.springframework.web.server.ServerWebExchange;
+
+/**
+ * LoggingHuaweiLtsPlugin send log to Huawei lts service.
+ */
+public class LoggingHuaweiLtsPlugin extends
AbstractLoggingPlugin<ShenyuRequestLog> {
+ @Override
+ protected LogCollector<ShenyuRequestLog> logCollector() {
+ return HuaweiLtsLogCollector.getInstance();
+ }
+
+ /**
+ * pluginEnum.
+ *
+ * @return plugin
+ */
+ @Override
+ protected PluginEnum pluginEnum() {
+ return PluginEnum.LOGGING_HUAWEI_LTS;
+ }
+
+ /**
+ * log collect extension.
+ * base on ShenyuRequestLog to extend log
+ *
+ * @param exchange exchange
+ * @param selector selector
+ * @param rule rule
+ * @return base ShenyuRequestLog
+ */
+ @Override
+ protected ShenyuRequestLog doLogExecute(final ServerWebExchange exchange,
final SelectorData selector, final RuleData rule) {
+ return new ShenyuRequestLog();
+ }
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/client/HuaweiLtsLogCollectClient.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/client/HuaweiLtsLogCollectClient.java
new file mode 100644
index 000000000..3ecc8db81
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/client/HuaweiLtsLogCollectClient.java
@@ -0,0 +1,212 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts.client;
+
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.huaweicloud.lts.appender.JavaSDKAppender;
+import com.huaweicloud.lts.producer.Producer;
+import com.huaweicloud.lts.producer.Result;
+import com.huaweicloud.lts.producer.exception.LogSizeTooLargeException;
+import com.huaweicloud.lts.producer.exception.MaxBatchCountExceedException;
+import com.huaweicloud.lts.producer.exception.ProducerException;
+import com.huaweicloud.lts.producer.exception.ResultFailedException;
+import com.huaweicloud.lts.producer.model.log.LogContent;
+import com.huaweicloud.lts.producer.model.log.LogItem;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shenyu.common.concurrent.ShenyuThreadFactory;
+import org.apache.shenyu.plugin.huawei.lts.config.HuaweiLogCollectConfig;
+import org.apache.shenyu.plugin.logging.common.client.AbstractLogConsumeClient;
+import org.apache.shenyu.plugin.logging.common.constant.GenericLoggingConstant;
+import org.apache.shenyu.plugin.logging.common.entity.ShenyuRequestLog;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.lang.NonNull;
+
+import javax.annotation.Nullable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Huawei lts log Collect client.
+ */
+public class HuaweiLtsLogCollectClient extends
AbstractLogConsumeClient<HuaweiLogCollectConfig.HuaweiLtsLogConfig,
ShenyuRequestLog> {
+
+ private Producer producer;
+
+ private String logGroupId;
+
+ private String logStreamId;
+
+ private String projectId;
+
+ private ThreadPoolExecutor threadExecutor;
+
+ /**
+ * init Huawei lts client.
+ *
+ * @param huaweiLtsLogConfig shenyu log config
+ */
+ @Override
+ public void initClient0(@NonNull final
HuaweiLogCollectConfig.HuaweiLtsLogConfig huaweiLtsLogConfig) {
+ final String accessKeyId = huaweiLtsLogConfig.getAccessKeyId();
+ final String accessKeySecret = huaweiLtsLogConfig.getAccessKeySecret();
+ final String regionName = huaweiLtsLogConfig.getRegionName();
+ this.projectId = huaweiLtsLogConfig.getProjectId();
+ this.logGroupId = huaweiLtsLogConfig.getLogGroupId();
+ this.logStreamId = huaweiLtsLogConfig.getLogStreamId();
+ if (StringUtils.isBlank(accessKeyId) ||
StringUtils.isBlank(accessKeySecret) || StringUtils.isBlank(projectId)
+ || StringUtils.isBlank(regionName) ||
StringUtils.isBlank(logGroupId) || StringUtils.isBlank(logStreamId)) {
+ LOG.error("init Huawei lts client error, please check projectId,
accessKeyId, accessKeySecret, regionName, logGroupId or logStreamId");
+ return;
+ }
+ JavaSDKAppender appender = JavaSDKAppender.custom()
+ .setProjectId(projectId)
+ .setAccessKeyId(accessKeyId)
+ .setAccessKeySecret(accessKeySecret)
+ .setRegionName(regionName)
+ .setTotalSizeInBytes(huaweiLtsLogConfig.getTotalSizeInBytes())
+ .setMaxBlockMs(huaweiLtsLogConfig.getMaxBlockMs())
+
.setBatchSizeThresholdInBytes(huaweiLtsLogConfig.getBatchSizeThresholdInBytes())
+
.setBatchCountThreshold(huaweiLtsLogConfig.getBatchCountThreshold())
+ .setLingerMs(huaweiLtsLogConfig.getLingerMs())
+ .setRetries(huaweiLtsLogConfig.getRetries())
+
.setBaseRetryBackoffMs(huaweiLtsLogConfig.getBaseRetryBackoffMs())
+
.setMaxRetryBackoffMs(huaweiLtsLogConfig.getMaxRetryBackoffMs())
+
.setEnableLocalTest(Boolean.parseBoolean(huaweiLtsLogConfig.getEnableLocalTest()))
+
.setGiveUpExtraLongSingleLog(Boolean.parseBoolean(huaweiLtsLogConfig.getEnableLocalTest()))
+ .builder();
+ this.producer = appender.getProducer();
+
+ threadExecutor =
createThreadPoolExecutor(huaweiLtsLogConfig.getIoThreadCount());
+ }
+
+ /**
+ * Huawei lts consume.
+ *
+ * @param logs list of log
+ */
+ @Override
+ public void consume0(@NonNull final List<ShenyuRequestLog> logs) throws
Exception {
+ logs.forEach(this::sendLog);
+ }
+
+ @Override
+ public void close0() throws Exception {
+ if (Objects.nonNull(producer)) {
+ try {
+ producer.close();
+
+ } catch (InterruptedException | ProducerException e) {
+ LOG.error("Close producer error.");
+ }
+ }
+ }
+
+ /**
+ * send log to Huawei lts.
+ *
+ * @param log log
+ */
+ private void sendLog(final ShenyuRequestLog log) {
+ final List<LogItem> logItems = new ArrayList<>();
+ final List<LogItem> logItemList = new ArrayList<>();
+ LogItem logItem = new LogItem();
+ logItem.setTenantProjectId(projectId);
+ logItems.add(logItem);
+ logItem.setLabels(JSONObject.toJSONString(new HashMap<>()));
+ List<LogContent> contents = new ArrayList<>();
+ LogContent logContent = new LogContent();
+ logContent.setLogTimeNs(System.currentTimeMillis() * 1000000L +
System.nanoTime() % 1000000L);
+ logContent.setLog(log.toString());
+ contents.add(logContent);
+ logItem.setContents(contents);
+ logItemList.add(logItem);
+
+ try {
+ final ListenableFuture<Result> f = producer.send(logGroupId,
logStreamId, logItemList);
+ Futures.addCallback(f, new ProducerFutureCallback(logGroupId,
logStreamId), threadExecutor);
+ } catch (InterruptedException e) {
+ LOG.warn("The current thread has been interrupted during send
logs.");
+ } catch (ProducerException e) {
+ if (e instanceof MaxBatchCountExceedException) {
+ LOG.error("The logs exceeds the maximum batch count, e={}",
e.getMessage());
+ } else if (e instanceof LogSizeTooLargeException) {
+ LOG.error("The size of log is larger than the maximum
allowable size, e={}", e.getMessage());
+ } else {
+ LOG.error("Failed to send logs, e={}", e.getMessage());
+ }
+ }
+ }
+
+ /**
+ * create send log queue.
+ *
+ * @param sendThreadCount sendThreadCount
+ * @return ThreadPoolExecutor
+ */
+ private static ThreadPoolExecutor createThreadPoolExecutor(final int
sendThreadCount) {
+ int threadCount = sendThreadCount;
+ if (threadCount > GenericLoggingConstant.MAX_ALLOW_THREADS) {
+ LOG.warn("send thread count number too large!");
+ threadCount = GenericLoggingConstant.MAX_ALLOW_THREADS;
+ }
+ return new ThreadPoolExecutor(threadCount,
GenericLoggingConstant.MAX_ALLOW_THREADS, 60000L, TimeUnit.MICROSECONDS,
+ new
LinkedBlockingQueue<>(GenericLoggingConstant.MAX_QUEUE_NUMBER),
ShenyuThreadFactory.create("shenyu-huawei-lts", true),
+ new ThreadPoolExecutor.AbortPolicy());
+ }
+
+ /**
+ * Producer Future Callback.
+ */
+ private static final class ProducerFutureCallback implements
FutureCallback<Result> {
+
+ private static final Logger LOGGER =
LoggerFactory.getLogger(ProducerFutureCallback.class);
+
+ private final String logGroupId;
+
+ private final String logStreamId;
+
+ ProducerFutureCallback(final String logGroupId, final String
logStreamId) {
+ this.logGroupId = logGroupId;
+ this.logStreamId = logStreamId;
+ }
+
+ @Override
+ public void onSuccess(@Nullable final Result result) {
+ LOGGER.info("Send logs to Huawei lts successfully.");
+ }
+
+ @Override
+ public void onFailure(final Throwable throwable) {
+ if (throwable instanceof ResultFailedException) {
+ Result result = ((ResultFailedException)
throwable).getResult();
+ LOGGER.error("Failed to send logs, logGroupId={},
logStreamId={}, result={}", logGroupId, logStreamId, result);
+ } else {
+ LOGGER.error("Failed to send log, e={}",
throwable.getMessage());
+ }
+ }
+ }
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/collector/HuaweiLtsLogCollector.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/collector/HuaweiLtsLogCollector.java
new file mode 100644
index 000000000..e16b6ad75
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/collector/HuaweiLtsLogCollector.java
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts.collector;
+
+import org.apache.shenyu.plugin.huawei.lts.client.HuaweiLtsLogCollectClient;
+import
org.apache.shenyu.plugin.huawei.lts.handler.LoggingHuaweiLtsPluginDataHandler;
+import org.apache.shenyu.plugin.logging.common.collector.AbstractLogCollector;
+import org.apache.shenyu.plugin.logging.common.collector.LogCollector;
+import org.apache.shenyu.plugin.logging.common.entity.ShenyuRequestLog;
+import org.apache.shenyu.plugin.logging.desensitize.api.matcher.KeyWordMatch;
+
+/**
+ * Huawei lts log collector,depend a LogConsumeClient for consume logs.
+ */
+public class HuaweiLtsLogCollector extends
AbstractLogCollector<HuaweiLtsLogCollectClient, ShenyuRequestLog> {
+
+ private static final LogCollector<ShenyuRequestLog> INSTANCE = new
HuaweiLtsLogCollector();
+
+ /**
+ * get LogCollector instance.
+ *
+ * @return LogCollector instance
+ */
+ public static LogCollector<ShenyuRequestLog> getInstance() {
+ return INSTANCE;
+ }
+
+ @Override
+ protected HuaweiLtsLogCollectClient getLogConsumeClient() {
+ return
LoggingHuaweiLtsPluginDataHandler.getHuaweiLtsLogCollectClient();
+ }
+
+ @Override
+ protected void desensitizeLog(final ShenyuRequestLog log, final
KeyWordMatch keyWordMatch, final String desensitizeAlg) {
+
+ }
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/config/HuaweiLogCollectConfig.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/config/HuaweiLogCollectConfig.java
new file mode 100644
index 000000000..9d0d831ca
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/config/HuaweiLogCollectConfig.java
@@ -0,0 +1,485 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts.config;
+
+import org.apache.shenyu.plugin.logging.common.config.GenericGlobalConfig;
+
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * LogCollectConfig.
+ */
+public class HuaweiLogCollectConfig {
+ public static final HuaweiLogCollectConfig INSTANCE = new
HuaweiLogCollectConfig();
+
+ private HuaweiLtsLogConfig huaweiLtsLogConfig;
+
+ /**
+ * get Huawei lts log config.
+ *
+ * @return global log config
+ */
+ public HuaweiLtsLogConfig getHuaweiLogCollectConfig() {
+ return Optional.ofNullable(huaweiLtsLogConfig).orElse(new
HuaweiLtsLogConfig());
+ }
+
+ /**
+ * set Huawei lts log config.
+ *
+ * @param huaweiLtsLogConfig Tencent cls log config.
+ */
+ public void setHuaweiLtsLogConfig(final HuaweiLtsLogConfig
huaweiLtsLogConfig) {
+ this.huaweiLtsLogConfig = huaweiLtsLogConfig;
+ }
+
+ /**
+ * global log config.
+ * please see
https://support.huaweicloud.com/usermanual-lts/lts_03_1003.html
+ */
+ public static class HuaweiLtsLogConfig extends GenericGlobalConfig {
+
+ /**
+ * huawei projectId.
+ */
+ private String projectId;
+
+ /**
+ * huawei logGroupId.
+ */
+ private String logGroupId;
+
+ /**
+ * huawei logStreamId.
+ */
+ private String logStreamId;
+
+ /**
+ * huawei accessKeyId.
+ */
+ private String accessKeyId;
+
+ /**
+ * huawei accessKeySecret.
+ */
+ private String accessKeySecret;
+
+ /**
+ * huawei regionName.
+ */
+ private String regionName;
+
+ /**
+ * huawei totalSizeInBytes.
+ */
+ private Integer totalSizeInBytes = 104857600;
+
+ /**
+ * huawei maxBlockMs.
+ */
+ private Long maxBlockMs = 0L;
+
+ /**
+ * huawei ioThreadCount.
+ */
+ private Integer ioThreadCount = 1;
+
+ /**
+ * huawei batchSizeThresholdInBytes.
+ */
+ private Integer batchSizeThresholdInBytes = 524288;
+
+ /**
+ * huawei batchCountThreshold.
+ */
+ private Integer batchCountThreshold = 4096;
+
+ /**
+ * huawei lingerMs.
+ */
+ private Integer lingerMs = 2000;
+
+ /**
+ * huawei retries.
+ */
+ private Integer retries = 1;
+
+ /**
+ * huawei baseRetryBackoffMs.
+ */
+ private Long baseRetryBackoffMs = 100L;
+
+ /**
+ * huawei maxRetryBackoffMs.
+ */
+ private Long maxRetryBackoffMs = 100L;
+
+ /**
+ * huawei enableLocalTest.
+ */
+ private String enableLocalTest = "true";
+
+ /**
+ * huawei setGiveUpExtraLongSingleLog.
+ */
+ private String setGiveUpExtraLongSingleLog = "true";
+
+ /**
+ * getProjectId.
+ *
+ * @return projectId
+ */
+ public String getProjectId() {
+ return projectId;
+ }
+
+ /**
+ * set projectId.
+ *
+ * @param projectId projectId
+ */
+ public void setProjectId(final String projectId) {
+ this.projectId = projectId;
+ }
+
+ /**
+ * getLogGroupId.
+ *
+ * @return logGroupId
+ */
+ public String getLogGroupId() {
+ return logGroupId;
+ }
+
+ /**
+ * set logGroupId.
+ *
+ * @param logGroupId logGroupId
+ */
+ public void setLogGroupId(final String logGroupId) {
+ this.logGroupId = logGroupId;
+ }
+
+ /**
+ * getLogStreamId.
+ *
+ * @return logStreamId
+ */
+ public String getLogStreamId() {
+ return logStreamId;
+ }
+
+ /**
+ * set logStreamId.
+ *
+ * @param logStreamId logStreamId
+ */
+ public void setLogStreamId(final String logStreamId) {
+ this.logStreamId = logStreamId;
+ }
+
+ /**
+ * getAccessKeyId.
+ *
+ * @return accessKeyId
+ */
+ public String getAccessKeyId() {
+ return accessKeyId;
+ }
+
+ /**
+ * set accessKeyId.
+ *
+ * @param accessKeyId accessKeyId
+ */
+ public void setAccessKeyId(final String accessKeyId) {
+ this.accessKeyId = accessKeyId;
+ }
+
+ /**
+ * getAccessKeySecret.
+ *
+ * @return accessKeySecret
+ */
+ public String getAccessKeySecret() {
+ return accessKeySecret;
+ }
+
+ /**
+ * set accessKeySecret.
+ *
+ * @param accessKeySecret accessKeySecret
+ */
+ public void setAccessKeySecret(final String accessKeySecret) {
+ this.accessKeySecret = accessKeySecret;
+ }
+
+ /**
+ * getRegionName.
+ *
+ * @return regionName
+ */
+ public String getRegionName() {
+ return regionName;
+ }
+
+ /**
+ * set regionName.
+ *
+ * @param regionName regionName
+ */
+ public void setRegionName(final String regionName) {
+ this.regionName = regionName;
+ }
+
+ /**
+ * getTotalSizeInBytes.
+ *
+ * @return totalSizeInBytes
+ */
+ public Integer getTotalSizeInBytes() {
+ return totalSizeInBytes;
+ }
+
+ /**
+ * set totalSizeInBytes.
+ *
+ * @param totalSizeInBytes totalSizeInBytes
+ */
+ public void setTotalSizeInBytes(final Integer totalSizeInBytes) {
+ this.totalSizeInBytes = totalSizeInBytes;
+ }
+
+ /**
+ * getMaxBlockMs.
+ *
+ * @return maxBlockMs
+ */
+ public Long getMaxBlockMs() {
+ return maxBlockMs;
+ }
+
+ /**
+ * set maxBlockMs.
+ *
+ * @param maxBlockMs maxBlockMs
+ */
+ public void setMaxBlockMs(final Long maxBlockMs) {
+ this.maxBlockMs = maxBlockMs;
+ }
+
+ /**
+ * getIoThreadCount.
+ *
+ * @return ioThreadCount
+ */
+ public Integer getIoThreadCount() {
+ return ioThreadCount;
+ }
+
+ /**
+ * set ioThreadCount.
+ *
+ * @param ioThreadCount ioThreadCount
+ */
+ public void setIoThreadCount(final Integer ioThreadCount) {
+ this.ioThreadCount = ioThreadCount;
+ }
+
+ /**
+ * getBatchSizeThresholdInBytes.
+ *
+ * @return batchSizeThresholdInBytes
+ */
+ public Integer getBatchSizeThresholdInBytes() {
+ return batchSizeThresholdInBytes;
+ }
+
+ /**
+ * set batchSizeThresholdInBytes.
+ *
+ * @param batchSizeThresholdInBytes batchSizeThresholdInBytes
+ */
+ public void setBatchSizeThresholdInBytes(final Integer
batchSizeThresholdInBytes) {
+ this.batchSizeThresholdInBytes = batchSizeThresholdInBytes;
+ }
+
+ /**
+ * getBatchCountThreshold.
+ *
+ * @return batchCountThreshold
+ */
+ public Integer getBatchCountThreshold() {
+ return batchCountThreshold;
+ }
+
+ /**
+ * set batchCountThreshold.
+ *
+ * @param batchCountThreshold batchCountThreshold
+ */
+ public void setBatchCountThreshold(final Integer batchCountThreshold) {
+ this.batchCountThreshold = batchCountThreshold;
+ }
+
+ /**
+ * getLingerMs.
+ *
+ * @return lingerMs
+ */
+ public Integer getLingerMs() {
+ return lingerMs;
+ }
+
+ /**
+ * set lingerMs.
+ *
+ * @param lingerMs lingerMs
+ */
+ public void setLingerMs(final Integer lingerMs) {
+ this.lingerMs = lingerMs;
+ }
+
+ /**
+ * getRetries.
+ *
+ * @return retries
+ */
+ public Integer getRetries() {
+ return retries;
+ }
+
+ /**
+ * set retries.
+ *
+ * @param retries retries
+ */
+ public void setRetries(final Integer retries) {
+ this.retries = retries;
+ }
+
+ /**
+ * getBaseRetryBackoffMs.
+ *
+ * @return baseRetryBackoffMs
+ */
+ public Long getBaseRetryBackoffMs() {
+ return baseRetryBackoffMs;
+ }
+
+ /**
+ * set baseRetryBackoffMs.
+ *
+ * @param baseRetryBackoffMs baseRetryBackoffMs
+ */
+ public void setBaseRetryBackoffMs(final Long baseRetryBackoffMs) {
+ this.baseRetryBackoffMs = baseRetryBackoffMs;
+ }
+
+ /**
+ * getMaxRetryBackoffMs.
+ *
+ * @return maxRetryBackoffMs
+ */
+ public Long getMaxRetryBackoffMs() {
+ return maxRetryBackoffMs;
+ }
+
+ /**
+ * set maxRetryBackoffMs.
+ *
+ * @param maxRetryBackoffMs maxRetryBackoffMs
+ */
+ public void setMaxRetryBackoffMs(final Long maxRetryBackoffMs) {
+ this.maxRetryBackoffMs = maxRetryBackoffMs;
+ }
+
+ /**
+ * getEnableLocalTest.
+ *
+ * @return enableLocalTest
+ */
+ public String getEnableLocalTest() {
+ return enableLocalTest;
+ }
+
+ /**
+ * set enableLocalTest.
+ *
+ * @param enableLocalTest enableLocalTest
+ */
+ public void setEnableLocalTest(final String enableLocalTest) {
+ this.enableLocalTest = enableLocalTest;
+ }
+
+ /**
+ * getSetGiveUpExtraLongSingleLog.
+ *
+ * @return setGiveUpExtraLongSingleLog
+ */
+ public String getSetGiveUpExtraLongSingleLog() {
+ return setGiveUpExtraLongSingleLog;
+ }
+
+ /**
+ * set setGiveUpExtraLongSingleLog.
+ *
+ * @param setGiveUpExtraLongSingleLog setGiveUpExtraLongSingleLog
+ */
+ public void setSetGiveUpExtraLongSingleLog(final String
setGiveUpExtraLongSingleLog) {
+ this.setGiveUpExtraLongSingleLog = setGiveUpExtraLongSingleLog;
+ }
+
+ @Override
+ public boolean equals(final Object o) {
+ if (this == o) {
+ return Boolean.TRUE;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return Boolean.FALSE;
+ }
+ HuaweiLtsLogConfig that = (HuaweiLtsLogConfig) o;
+ return Objects.equals(getProjectId(), that.getProjectId())
+ && Objects.equals(getLogGroupId(), that.getLogGroupId())
+ && Objects.equals(getLogStreamId(), that.getLogStreamId())
+ && Objects.equals(getAccessKeyId(), that.getAccessKeyId())
+ && Objects.equals(getAccessKeySecret(),
that.getAccessKeySecret())
+ && Objects.equals(getRegionName(),
that.getTotalSizeInBytes())
+ && Objects.equals(getTotalSizeInBytes(),
that.getTotalSizeInBytes())
+ && Objects.equals(getMaxBlockMs(), that.getMaxBlockMs())
+ && Objects.equals(getIoThreadCount(),
that.getIoThreadCount())
+ && Objects.equals(getBatchSizeThresholdInBytes(),
that.getBatchSizeThresholdInBytes())
+ && Objects.equals(getBatchCountThreshold(),
that.getBatchCountThreshold())
+ && Objects.equals(getLingerMs(), that.getLingerMs())
+ && Objects.equals(getRetries(), that.getRetries())
+ && Objects.equals(getBaseRetryBackoffMs(),
that.getBaseRetryBackoffMs())
+ && Objects.equals(getMaxRetryBackoffMs(),
that.getMaxRetryBackoffMs())
+ && Objects.equals(getEnableLocalTest(),
that.getEnableLocalTest())
+ && Objects.equals(getSetGiveUpExtraLongSingleLog(),
that.getSetGiveUpExtraLongSingleLog());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(projectId, logGroupId, logStreamId,
accessKeyId, accessKeySecret,
+ regionName, totalSizeInBytes, maxBlockMs, ioThreadCount,
+ batchSizeThresholdInBytes, batchCountThreshold, lingerMs,
+ retries, baseRetryBackoffMs, maxRetryBackoffMs,
enableLocalTest,
+ setGiveUpExtraLongSingleLog);
+ }
+ }
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/handler/LoggingHuaweiLtsPluginDataHandler.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/handler/LoggingHuaweiLtsPluginDataHandler.java
new file mode 100644
index 000000000..6e57c1bc1
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/plugin/huawei/lts/handler/LoggingHuaweiLtsPluginDataHandler.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts.handler;
+
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.plugin.huawei.lts.client.HuaweiLtsLogCollectClient;
+import org.apache.shenyu.plugin.huawei.lts.collector.HuaweiLtsLogCollector;
+import org.apache.shenyu.plugin.huawei.lts.config.HuaweiLogCollectConfig;
+import org.apache.shenyu.plugin.logging.common.collector.LogCollector;
+import org.apache.shenyu.plugin.logging.common.config.GenericApiConfig;
+import
org.apache.shenyu.plugin.logging.common.handler.AbstractLogPluginDataHandler;
+
+/**
+ * LoggingHuaweiLtsPluginDataHandler Huawei lts plugin data handler.
+ */
+public class LoggingHuaweiLtsPluginDataHandler extends
AbstractLogPluginDataHandler<HuaweiLogCollectConfig.HuaweiLtsLogConfig,
GenericApiConfig> {
+
+ private static final HuaweiLtsLogCollectClient
HUAWEI_LTS_LOG_COLLECT_CLIENT = new HuaweiLtsLogCollectClient();
+
+ @Override
+ public String pluginNamed() {
+ return PluginEnum.LOGGING_HUAWEI_LTS.getName();
+ }
+
+ /**
+ * logCollector.
+ */
+ @Override
+ protected LogCollector logCollector() {
+ return HuaweiLtsLogCollector.getInstance();
+ }
+
+ /**
+ * doRefreshConfig.
+ *
+ * @param globalLogConfig globalLogConfig
+ */
+ @Override
+ protected void doRefreshConfig(final
HuaweiLogCollectConfig.HuaweiLtsLogConfig globalLogConfig) {
+ HuaweiLogCollectConfig.INSTANCE.setHuaweiLtsLogConfig(globalLogConfig);
+ HUAWEI_LTS_LOG_COLLECT_CLIENT.initClient(globalLogConfig);
+ }
+
+ /**
+ * get Huawei log collect client.
+ * @return Huawei lts log collect client.
+ */
+ public static HuaweiLtsLogCollectClient getHuaweiLtsLogCollectClient() {
+ return HUAWEI_LTS_LOG_COLLECT_CLIENT;
+ }
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/LoggingHuaweiLtsPluginTest.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/LoggingHuaweiLtsPluginTest.java
new file mode 100644
index 000000000..5c002473a
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/LoggingHuaweiLtsPluginTest.java
@@ -0,0 +1,104 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts;
+
+import org.apache.shenyu.common.constant.Constants;
+import org.apache.shenyu.common.dto.RuleData;
+import org.apache.shenyu.common.dto.SelectorData;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.plugin.api.RemoteAddressResolver;
+import org.apache.shenyu.plugin.api.ShenyuPluginChain;
+import org.apache.shenyu.plugin.api.context.ShenyuContext;
+import org.apache.shenyu.plugin.api.utils.SpringBeanUtils;
+import org.apache.shenyu.plugin.logging.common.entity.ShenyuRequestLog;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.ArgumentMatchers;
+import org.mockito.Mockito;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.http.server.reactive.ServerHttpRequest;
+import org.springframework.mock.http.server.reactive.MockServerHttpRequest;
+import org.springframework.mock.web.server.MockServerWebExchange;
+import org.springframework.web.server.ServerWebExchange;
+import reactor.core.publisher.Mono;
+import reactor.test.StepVerifier;
+
+import java.net.InetSocketAddress;
+
+@ExtendWith(MockitoExtension.class)
+public class LoggingHuaweiLtsPluginTest {
+
+ private LoggingHuaweiLtsPlugin loggingHuaweiLtsPlugin;
+
+ private ServerWebExchange exchange;
+
+ private RuleData ruleData;
+
+ private ShenyuPluginChain chain;
+
+ private SelectorData selectorData;
+
+ private ServerHttpRequest request;
+
+ private ShenyuRequestLog requestLog;
+
+ @BeforeEach
+ public void setUp() {
+ this.loggingHuaweiLtsPlugin = new LoggingHuaweiLtsPlugin();
+ this.ruleData = Mockito.mock(RuleData.class);
+ this.chain = Mockito.mock(ShenyuPluginChain.class);
+ this.selectorData = Mockito.mock(SelectorData.class);
+ this.request = Mockito.mock(ServerHttpRequest.class);
+ this.requestLog = new ShenyuRequestLog();
+ MockServerHttpRequest request = MockServerHttpRequest
+ .get("localhost")
+ .remoteAddress(new InetSocketAddress(8090))
+ .header("X-source", "mock test")
+ .queryParam("queryParam", "Hello,World")
+ .build();
+ ConfigurableApplicationContext context =
Mockito.mock(ConfigurableApplicationContext.class);
+ SpringBeanUtils.getInstance().setApplicationContext(context);
+ RemoteAddressResolver remoteAddressResolver = new
RemoteAddressResolver() {
+ };
+
Mockito.lenient().when(context.getBean(RemoteAddressResolver.class)).thenReturn(remoteAddressResolver);
+ this.exchange = Mockito.spy(MockServerWebExchange.from(request));
+ ShenyuContext shenyuContext = Mockito.mock(ShenyuContext.class);
+ exchange.getAttributes().put(Constants.CONTEXT, shenyuContext);
+ }
+
+ @Test
+ public void testDoExecute() {
+
Mockito.when(chain.execute(ArgumentMatchers.any())).thenReturn(Mono.empty());
+ Mono<Void> result = loggingHuaweiLtsPlugin.doExecute(exchange, chain,
selectorData, ruleData);
+ StepVerifier.create(result).expectSubscription().verifyComplete();
+ }
+
+ @Test
+ public void testGetOrder() {
+ Assertions.assertEquals(loggingHuaweiLtsPlugin.getOrder(),
PluginEnum.LOGGING_HUAWEI_LTS.getCode());
+ }
+
+ @Test
+ public void testNamed() {
+ Assertions.assertEquals(loggingHuaweiLtsPlugin.named(),
PluginEnum.LOGGING_HUAWEI_LTS.getName());
+ }
+
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/client/HuaweiLtsLogCollectClientTest.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/client/HuaweiLtsLogCollectClientTest.java
new file mode 100644
index 000000000..7f435a2a1
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/client/HuaweiLtsLogCollectClientTest.java
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts.client;
+
+import org.apache.shenyu.common.dto.PluginData;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.plugin.huawei.lts.config.HuaweiLogCollectConfig;
+import org.apache.shenyu.plugin.logging.common.entity.ShenyuRequestLog;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+
+public class HuaweiLtsLogCollectClientTest {
+ private HuaweiLtsLogCollectClient huaweiLtsLogCollectClient;
+
+ private final PluginData pluginData = new PluginData();
+
+ private HuaweiLogCollectConfig.HuaweiLtsLogConfig huaweiLtsLogConfig;
+
+ private final List<ShenyuRequestLog> logs = new ArrayList<>();
+
+ private final ShenyuRequestLog shenyuRequestLog = new ShenyuRequestLog();
+
+ @BeforeEach
+ public void setup() {
+ this.huaweiLtsLogCollectClient = new HuaweiLtsLogCollectClient();
+ pluginData.setEnabled(true);
+ pluginData.setConfig("{\n"
+ + " \"projectId\": \"projectId\",\n"
+ + " \"logGroupId\": \"logGroupId\",\n"
+ + " \"logStreamId\": \"logStreamId\",\n"
+ + " \"accessKeyId\": \"accessKeyId\",\n"
+ + " \"accessKeySecret\": \"accessKeySecret\",\n"
+ + " \"regionName\": \"regionName\"\n"
+ + "}");
+ huaweiLtsLogConfig =
GsonUtils.getInstance().fromJson(pluginData.getConfig(),
+ HuaweiLogCollectConfig.HuaweiLtsLogConfig.class);
+ shenyuRequestLog.setClientIp("0.0.0.0");
+ shenyuRequestLog.setPath("org/apache/shenyu/plugin/logging");
+ shenyuRequestLog.setRequestUri("org/apache/shenyu/plugin/logging");
+ logs.add(shenyuRequestLog);
+ }
+
+ @Test
+ public void testInitClient() throws NoSuchFieldException,
IllegalAccessException {
+ huaweiLtsLogCollectClient.initClient(huaweiLtsLogConfig);
+ Field field =
huaweiLtsLogCollectClient.getClass().getDeclaredField("logGroupId");
+ field.setAccessible(true);
+ Assertions.assertEquals(field.get(huaweiLtsLogCollectClient),
"logGroupId");
+ huaweiLtsLogCollectClient.close();
+ }
+
+ @Test
+ public void testConsume() {
+ String msg = "";
+
HuaweiLogCollectConfig.INSTANCE.setHuaweiLtsLogConfig(huaweiLtsLogConfig);
+ huaweiLtsLogCollectClient.initClient(huaweiLtsLogConfig);
+ try {
+ huaweiLtsLogCollectClient.consume(logs);
+ } catch (Exception e) {
+ msg = "false";
+ }
+ Assertions.assertEquals(msg, "");
+ Assertions.assertEquals(huaweiLtsLogConfig,
+ HuaweiLogCollectConfig.INSTANCE.getHuaweiLogCollectConfig());
+ huaweiLtsLogCollectClient.close();
+ }
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/collector/HuaweiLtsLogCollectorTest.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/collector/HuaweiLtsLogCollectorTest.java
new file mode 100644
index 000000000..910dea83d
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/collector/HuaweiLtsLogCollectorTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts.collector;
+
+import org.apache.shenyu.plugin.huawei.lts.client.HuaweiLtsLogCollectClient;
+import org.apache.shenyu.plugin.logging.common.client.LogConsumeClient;
+import org.apache.shenyu.plugin.logging.common.collector.AbstractLogCollector;
+import org.apache.shenyu.plugin.logging.common.entity.ShenyuRequestLog;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.lang.reflect.Field;
+
+public class HuaweiLtsLogCollectorTest {
+
+ private final ShenyuRequestLog shenyuRequestLog = new ShenyuRequestLog();
+
+ @BeforeEach
+ public void setUp() {
+ shenyuRequestLog.setClientIp("0.0.0.0");
+ shenyuRequestLog.setPath("org/apache/shenyu/plugin/logging");
+ }
+
+ @Test
+ public void testAbstractLogCollector() throws Exception {
+ HuaweiLtsLogCollector.getInstance().start();
+ Field field1 = AbstractLogCollector.class.getDeclaredField("started");
+ field1.setAccessible(true);
+
Assertions.assertEquals(field1.get(HuaweiLtsLogCollector.getInstance()).toString(),
"true");
+ HuaweiLtsLogCollector.getInstance().collect(shenyuRequestLog);
+ HuaweiLtsLogCollector.getInstance().close();
+ Field field2 = AbstractLogCollector.class.getDeclaredField("started");
+ field2.setAccessible(true);
+
Assertions.assertEquals(field2.get(HuaweiLtsLogCollector.getInstance()).toString(),
"false");
+ }
+
+ @Test
+ public void testGetLogConsumeClient() {
+ LogConsumeClient logConsumeClient = new
HuaweiLtsLogCollector().getLogConsumeClient();
+ Assertions.assertEquals(HuaweiLtsLogCollectClient.class,
logConsumeClient.getClass());
+ }
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/config/HuaweiLogCollectConfigTest.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/config/HuaweiLogCollectConfigTest.java
new file mode 100644
index 000000000..250e6cf0c
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/config/HuaweiLogCollectConfigTest.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts.config;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class HuaweiLogCollectConfigTest {
+ private final HuaweiLogCollectConfig.HuaweiLtsLogConfig huaweiLtsLogConfig
= new HuaweiLogCollectConfig.HuaweiLtsLogConfig();
+
+ @Test
+ public void testLogCollectorConfigHost() {
+ huaweiLtsLogConfig.setAccessKeyId("AccessKeyId");
+ huaweiLtsLogConfig.setAccessKeySecret("AccessKeySecret");
+ huaweiLtsLogConfig.setRegionName("RegionName");
+ huaweiLtsLogConfig.setLogGroupId("LogGroupId");
+ huaweiLtsLogConfig.setLogStreamId("LogStreamId");
+ huaweiLtsLogConfig.setProjectId("ProjectId");
+ huaweiLtsLogConfig.setTotalSizeInBytes(104857600);
+ huaweiLtsLogConfig.setMaxBlockMs(0L);
+ huaweiLtsLogConfig.setIoThreadCount(8);
+ huaweiLtsLogConfig.setBatchSizeThresholdInBytes(524288);
+ huaweiLtsLogConfig.setBatchCountThreshold(4096);
+ huaweiLtsLogConfig.setLingerMs(2000);
+ huaweiLtsLogConfig.setRetries(1);
+ huaweiLtsLogConfig.setBaseRetryBackoffMs(100L);
+ huaweiLtsLogConfig.setMaxRetryBackoffMs(100L);
+ Assertions.assertEquals(huaweiLtsLogConfig.getAccessKeyId(),
"AccessKeyId");
+ Assertions.assertEquals(huaweiLtsLogConfig.getAccessKeySecret(),
"AccessKeySecret");
+ Assertions.assertEquals(huaweiLtsLogConfig.getRegionName(),
"RegionName");
+ Assertions.assertEquals(huaweiLtsLogConfig.getLogGroupId(),
"LogGroupId");
+ Assertions.assertEquals(huaweiLtsLogConfig.getLogStreamId(),
"LogStreamId");
+ Assertions.assertEquals(huaweiLtsLogConfig.getProjectId(),
"ProjectId");
+ Assertions.assertEquals(huaweiLtsLogConfig.getTotalSizeInBytes(),
104857600);
+ Assertions.assertEquals(huaweiLtsLogConfig.getMaxBlockMs(), 0L);
+ Assertions.assertEquals(huaweiLtsLogConfig.getIoThreadCount(), 8);
+
Assertions.assertEquals(huaweiLtsLogConfig.getBatchSizeThresholdInBytes(),
524288);
+ Assertions.assertEquals(huaweiLtsLogConfig.getBatchCountThreshold(),
4096);
+ Assertions.assertEquals(huaweiLtsLogConfig.getLingerMs(), 2000);
+ Assertions.assertEquals(huaweiLtsLogConfig.getRetries(), 1);
+ Assertions.assertEquals(huaweiLtsLogConfig.getBaseRetryBackoffMs(),
100L);
+ Assertions.assertEquals(huaweiLtsLogConfig.getMaxRetryBackoffMs(),
100L);
+ }
+}
diff --git
a/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/handler/LoggingHuaweiLtsPluginDataHandlerTest.java
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/handler/LoggingHuaweiLtsPluginDataHandlerTest.java
new file mode 100644
index 000000000..941fa414a
--- /dev/null
+++
b/shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/plugin/huawei/lts/handler/LoggingHuaweiLtsPluginDataHandlerTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.plugin.huawei.lts.handler;
+
+import org.apache.shenyu.common.dto.PluginData;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.plugin.huawei.lts.client.HuaweiLtsLogCollectClient;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.lang.reflect.Field;
+
+public class LoggingHuaweiLtsPluginDataHandlerTest {
+
+ private LoggingHuaweiLtsPluginDataHandler
loggingHuaweiLtsPluginDataHandler;
+
+ private final PluginData pluginData = new PluginData();
+
+ @BeforeEach
+ private void setUp() {
+ this.loggingHuaweiLtsPluginDataHandler = new
LoggingHuaweiLtsPluginDataHandler();
+ pluginData.setEnabled(true);
+ pluginData.setConfig("{\n"
+ + " \"projectId\": \"projectId\",\n"
+ + " \"logGroupId\": \"logGroupId\",\n"
+ + " \"logStreamId\": \"logStreamId\",\n"
+ + " \"accessKeyId\": \"accessKeyId\",\n"
+ + " \"accessKeySecret\": \"accessKeySecret\",\n"
+ + " \"regionName\": \"regionName\"\n"
+ + "}");
+ }
+
+ @Test
+ public void testHandlerPlugin() throws NoSuchFieldException,
IllegalAccessException {
+ loggingHuaweiLtsPluginDataHandler.handlerPlugin(pluginData);
+ Field field =
loggingHuaweiLtsPluginDataHandler.getClass().getDeclaredField("HUAWEI_LTS_LOG_COLLECT_CLIENT");
+ field.setAccessible(true);
+
Assertions.assertEquals(field.get(loggingHuaweiLtsPluginDataHandler).getClass(),
HuaweiLtsLogCollectClient.class);
+ pluginData.setEnabled(true);
+ loggingHuaweiLtsPluginDataHandler.handlerPlugin(pluginData);
+ }
+
+ @Test
+ public void testPluginNamed() {
+
Assertions.assertEquals(loggingHuaweiLtsPluginDataHandler.pluginNamed(),
PluginEnum.LOGGING_HUAWEI_LTS.getName());
+ }
+
+ @Test
+ public void testGetHuaweiLtsLogCollectClient() {
+
Assertions.assertEquals(LoggingHuaweiLtsPluginDataHandler.getHuaweiLtsLogCollectClient().getClass(),
HuaweiLtsLogCollectClient.class);
+ }
+}
diff --git
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/pom.xml
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/pom.xml
index e63840375..1073f4918 100644
--- a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/pom.xml
+++ b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/pom.xml
@@ -72,5 +72,6 @@
<module>shenyu-spring-boot-starter-plugin-brpc</module>
<module>shenyu-spring-boot-starter-plugin-tcp</module>
<module>shenyu-spring-boot-starter-plugin-transform</module>
+ <module>shenyu-spring-boot-starter-plugin-logging-huawei-lts</module>
</modules>
</project>
diff --git a/shenyu-plugin/shenyu-plugin-logging/pom.xml
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/pom.xml
similarity index 54%
copy from shenyu-plugin/shenyu-plugin-logging/pom.xml
copy to
shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/pom.xml
index 01d3428c5..76efab865 100644
--- a/shenyu-plugin/shenyu-plugin-logging/pom.xml
+++
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/pom.xml
@@ -16,34 +16,24 @@
~ limitations under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
+ <artifactId>shenyu-spring-boot-starter-plugin</artifactId>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-plugin</artifactId>
<version>2.6.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-plugin-logging</artifactId>
- <packaging>pom</packaging>
- <modules>
- <module>shenyu-plugin-logging-common</module>
- <module>shenyu-plugin-logging-console</module>
- <module>shenyu-plugin-logging-rocketmq</module>
- <module>shenyu-plugin-logging-kafka</module>
- <module>shenyu-plugin-logging-elasticsearch</module>
- <module>shenyu-plugin-logging-aliyun-sls</module>
- <module>shenyu-plugin-logging-pulsar</module>
- <module>shenyu-plugin-logging-tencent-cls</module>
- <module>shenyu-plugin-logging-clickhouse</module>
- <module>shenyu-plugin-logging-desensitize-api</module>
- </modules>
+
<artifactId>shenyu-spring-boot-starter-plugin-logging-huawei-lts</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu-plugin-base</artifactId>
+ <artifactId>shenyu-plugin-logging-huawei-lts</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
+
</project>
\ No newline at end of file
diff --git
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/springboot/starter/plugin/logging/huawei/lts/LoggingHuaweiLtsPluginConfiguration.java
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/springboot/starter/plugin/logging/huawei/lts/LoggingHuaweiLtsPluginConfiguration.java
new file mode 100644
index 000000000..978d8d9d1
--- /dev/null
+++
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/java/org/apache/shenyu/springboot/starter/plugin/logging/huawei/lts/LoggingHuaweiLtsPluginConfiguration.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.springboot.starter.plugin.logging.huawei.lts;
+
+import org.apache.shenyu.plugin.api.ShenyuPlugin;
+import org.apache.shenyu.plugin.base.handler.PluginDataHandler;
+import org.apache.shenyu.plugin.huawei.lts.LoggingHuaweiLtsPlugin;
+import
org.apache.shenyu.plugin.huawei.lts.handler.LoggingHuaweiLtsPluginDataHandler;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * The type Logging Huawei lts plugin configuration.
+ */
+@Configuration
+@ConditionalOnProperty(value = {"shenyu.plugins.logging-huawei-lts.enabled"},
havingValue = "true", matchIfMissing = true)
+public class LoggingHuaweiLtsPluginConfiguration {
+ /**
+ * logging Huawei lts plugin data handler.
+ *
+ * @return logging Huawei lts PluginDataHandler
+ */
+ @Bean
+ public PluginDataHandler loggingHuaweiLtsPluginDataHandler() {
+ return new LoggingHuaweiLtsPluginDataHandler();
+ }
+
+ /**
+ * Logging Huawei lts plugin.
+ *
+ * @return LoggingHuaweiLtsPlugin
+ */
+ @Bean
+ public ShenyuPlugin loggingHuaweiLtsPlugin() {
+ return new LoggingHuaweiLtsPlugin();
+ }
+
+}
diff --git
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/resources/META-INF/spring.factories
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/resources/META-INF/spring.factories
new file mode 100644
index 000000000..512be80c6
--- /dev/null
+++
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+org.apache.shenyu.springboot.starter.plugin.logging.huawei.lts.LoggingHuaweiLtsPluginConfiguration
\ No newline at end of file
diff --git
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/resources/META-INF/spring.provides
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/resources/META-INF/spring.provides
new file mode 100644
index 000000000..73e4998a6
--- /dev/null
+++
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/main/resources/META-INF/spring.provides
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+provides: shenyu-spring-boot-starter-plugin-logging-huawei-lts
diff --git
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/springboot/starter/plugin/logging/huawei/lts/LoggingHuaweiLtsPluginConfigurationTest.java
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/springboot/starter/plugin/logging/huawei/lts/LoggingHuaweiLtsPluginConfigurationTest.java
new file mode 100644
index 000000000..d6d9a6080
--- /dev/null
+++
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-logging-huawei-lts/src/test/java/org/apache/shenyu/springboot/starter/plugin/logging/huawei/lts/LoggingHuaweiLtsPluginConfigurationTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package org.apache.shenyu.springboot.starter.plugin.logging.huawei.lts;
+
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.plugin.api.ShenyuPlugin;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.autoconfigure.AutoConfigurations;
+import
org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.context.annotation.Configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * Test case for {@link LoggingHuaweiLtsPluginConfigurationTest}.
+ */
+@Configuration
+@EnableConfigurationProperties
+public class LoggingHuaweiLtsPluginConfigurationTest {
+ @Test
+ public void testLoggingPlugin() {
+ new ApplicationContextRunner()
+
.withConfiguration(AutoConfigurations.of(LoggingHuaweiLtsPluginConfiguration.class))
+ .withBean(LoggingHuaweiLtsPluginConfigurationTest.class)
+ .withPropertyValues("debug=true")
+ .run(context -> {
+ ShenyuPlugin plugin =
context.getBean("loggingHuaweiLtsPlugin", ShenyuPlugin.class);
+ assertNotNull(plugin);
+
assertThat(plugin.named()).isEqualTo(PluginEnum.LOGGING_HUAWEI_LTS.getName());
+ });
+ }
+}