You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2021/01/05 06:56:58 UTC
[shardingsphere] branch master updated: refactor logging plugin
(#8891)
This is an automated email from the ASF dual-hosted git repository.
zhangyonglun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 9c0495e refactor logging plugin (#8891)
9c0495e is described below
commit 9c0495e11ec392fc9e1da85f7f34ad093b4c65d0
Author: xiaoyu <54...@qq.com>
AuthorDate: Tue Jan 5 14:56:36 2021 +0800
refactor logging plugin (#8891)
---
.../src/test/resources/conf/agent.yaml | 5 ++-
.../src/main/resources/conf/agent.yaml | 3 ++
.../base/service/BaseLoggingPluginBootService.java | 40 ++++++++++++++++++++++
...hardingsphere.agent.spi.boot.PluginBootService} | 25 +-------------
4 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/test/resources/conf/agent.yaml b/shardingsphere-agent/shardingsphere-agent-core/src/test/resources/conf/agent.yaml
index 1e99774..84754f9 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/test/resources/conf/agent.yaml
+++ b/shardingsphere-agent/shardingsphere-agent-core/src/test/resources/conf/agent.yaml
@@ -38,4 +38,7 @@ plugins:
host: "localhost"
port: 15775
props:
- name: "Zipkin"
+ NAME: "Zipkin"
+ Logging:
+ props:
+ NAME: "Logging"
diff --git a/shardingsphere-agent/shardingsphere-agent-distribution/src/main/resources/conf/agent.yaml b/shardingsphere-agent/shardingsphere-agent-distribution/src/main/resources/conf/agent.yaml
index 4e6ece9..01d9c0e 100644
--- a/shardingsphere-agent/shardingsphere-agent-distribution/src/main/resources/conf/agent.yaml
+++ b/shardingsphere-agent/shardingsphere-agent-distribution/src/main/resources/conf/agent.yaml
@@ -39,3 +39,6 @@ plugins:
port: 15775
props:
NAME: "Zipkin"
+ Logging:
+ props:
+ LEVEL: "info"
diff --git a/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-logging/shardingsphere-agent-logging-base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/service/BaseLoggingPluginBootService.java b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-logging/shardingsphere-agent-logging-base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/service/BaseLoggingPluginBootService.java
new file mode 100644
index 0000000..eb864a9
--- /dev/null
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-logging/shardingsphere-agent-logging-base/src/main/java/org/apache/shardingsphere/agent/plugin/logging/base/service/BaseLoggingPluginBootService.java
@@ -0,0 +1,40 @@
+/*
+ * 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.shardingsphere.agent.plugin.logging.base.service;
+
+import org.apache.shardingsphere.agent.config.PluginConfiguration;
+import org.apache.shardingsphere.agent.spi.boot.PluginBootService;
+
+/**
+ * Base logging plugin boot service.
+ */
+public final class BaseLoggingPluginBootService implements PluginBootService {
+
+ @Override
+ public void start(final PluginConfiguration pluginConfig) {
+ }
+
+ @Override
+ public String getType() {
+ return "Logging";
+ }
+
+ @Override
+ public void close() {
+ }
+}
diff --git a/shardingsphere-agent/shardingsphere-agent-core/src/test/resources/conf/agent.yaml b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-logging/shardingsphere-agent-logging-base/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.boot.PluginBootService
similarity index 61%
copy from shardingsphere-agent/shardingsphere-agent-core/src/test/resources/conf/agent.yaml
copy to shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-logging/shardingsphere-agent-logging-base/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.boot.PluginBootService
index 1e99774..181b006 100644
--- a/shardingsphere-agent/shardingsphere-agent-core/src/test/resources/conf/agent.yaml
+++ b/shardingsphere-agent/shardingsphere-agent-plugins/shardingsphere-agent-plugin-logging/shardingsphere-agent-logging-base/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.boot.PluginBootService
@@ -15,27 +15,4 @@
# limitations under the License.
#
-applicationName: shardingsphere-agent
-metricsType : Prometheus
-ignoredPluginNames:
- - test
-
-plugins:
- prometheus:
- host: "localhost"
- port: 9090
- props:
- JVM_INFORMATION_COLLECTOR_ENABLED : "true"
- Jaeger:
- host: "localhost"
- port: 5775
- props:
- JAEGER_SAMPLER_TYPE: "const"
- JAEGER_SAMPLER_PARAM: "1"
- JAEGER_REPORTER_LOG_SPANS: "true"
- JAEGER_REPORTER_FLUSH_INTERVAL: "1"
- Zipkin:
- host: "localhost"
- port: 15775
- props:
- name: "Zipkin"
+org.apache.shardingsphere.agent.plugin.logging.base.service.BaseLoggingPluginBootService