You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2025/05/23 10:28:15 UTC
(shardingsphere) branch master updated: Remove configuration property key system-log-level (#35493)
This is an automated email from the ASF dual-hosted git repository.
yx9o 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 5a741ac8e41 Remove configuration property key system-log-level (#35493)
5a741ac8e41 is described below
commit 5a741ac8e413e2601642e7bcba6a2d022c20a936
Author: Raigor <ra...@gmail.com>
AuthorDate: Fri May 23 18:28:09 2025 +0800
Remove configuration property key system-log-level (#35493)
* Remove configuration property key system-log-level
* Update RELEASE-NOTES.md
* Update docs
---
RELEASE-NOTES.md | 2 +
...dingsphere-proxy-native-binary-distribution.xml | 8 ++++
.../shardingsphere-proxy-binary-distribution.xml | 8 ++++
.../shardingsphere-proxy/cdc/build.cn.md | 1 -
.../shardingsphere-proxy/cdc/build.en.md | 1 -
.../distsql/syntax/ral/set-dist-vairable.cn.md | 2 -
.../distsql/syntax/ral/set-dist-vairable.en.md | 2 -
.../distsql/syntax/ral/show-dist-variable.cn.md | 50 +++++++++++-----------
.../distsql/syntax/ral/show-dist-variable.en.md | 50 +++++++++++-----------
.../shardingsphere-proxy/yaml-config/props.cn.md | 1 -
.../shardingsphere-proxy/yaml-config/props.en.md | 1 -
.../config/props/ConfigurationPropertyKey.java | 6 ---
.../config/props/ConfigurationPropertiesTest.java | 4 --
.../ShardingSpherePipelineDataSourceCreator.java | 2 +-
.../variable/SetDistVariableExecutor.java | 15 -------
.../variable/ShowDistVariablesExecutorTest.java | 12 ++----
.../variable/SetDistVariableExecutorTest.java | 20 ---------
.../src/main/resources/{conf => }/logback.xml | 9 ++--
.../dataset/empty_rules/show_dist_variables.xml | 1 -
19 files changed, 77 insertions(+), 118 deletions(-)
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 2bed1b89ca1..106c95a7981 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -12,6 +12,8 @@
### API Changes
1. Remove SQL formatting feature [#35390](https://github.com/apache/shardingsphere/pull/35390)
+1. Remove logging rule feature [#35458](https://github.com/apache/shardingsphere/pull/35458)
+1. Remove configuration property key `system-log-level` [#35493](https://github.com/apache/shardingsphere/pull/35493)
### New Features
diff --git a/distribution/proxy-native/src/main/assembly/shardingsphere-proxy-native-binary-distribution.xml b/distribution/proxy-native/src/main/assembly/shardingsphere-proxy-native-binary-distribution.xml
index b449dac696f..bd1f795080a 100644
--- a/distribution/proxy-native/src/main/assembly/shardingsphere-proxy-native-binary-distribution.xml
+++ b/distribution/proxy-native/src/main/assembly/shardingsphere-proxy-native-binary-distribution.xml
@@ -39,6 +39,14 @@
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
+ <fileSet>
+ <directory>../../proxy/bootstrap/src/main/resources</directory>
+ <includes>
+ <include>logback.xml</include>
+ </includes>
+ <outputDirectory>conf</outputDirectory>
+ <fileMode>0644</fileMode>
+ </fileSet>
<fileSet>
<directory>../../distribution/proxy/src/main/release-docs</directory>
<includes>
diff --git a/distribution/proxy/src/main/assembly/shardingsphere-proxy-binary-distribution.xml b/distribution/proxy/src/main/assembly/shardingsphere-proxy-binary-distribution.xml
index c0adc65c1d8..12e02ed065a 100644
--- a/distribution/proxy/src/main/assembly/shardingsphere-proxy-binary-distribution.xml
+++ b/distribution/proxy/src/main/assembly/shardingsphere-proxy-binary-distribution.xml
@@ -48,6 +48,14 @@
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
+ <fileSet>
+ <directory>../../proxy/bootstrap/src/main/resources</directory>
+ <includes>
+ <include>logback.xml</include>
+ </includes>
+ <outputDirectory>conf</outputDirectory>
+ <fileMode>0644</fileMode>
+ </fileSet>
<fileSet>
<directory>src/main/release-docs</directory>
<includes>
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/cdc/build.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/cdc/build.cn.md
index 43c32bca50c..0ab44b135de 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/cdc/build.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/cdc/build.cn.md
@@ -87,7 +87,6 @@ authority:
# port: 6379
props:
- system-log-level: INFO
proxy-default-port: 3307 # Proxy default port
cdc-server-port: 33071 # CDC Server 端口,必须配置
proxy-frontend-database-protocol-type: openGauss # 和后端数据库的类型一致
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/cdc/build.en.md b/docs/document/content/user-manual/shardingsphere-proxy/cdc/build.en.md
index fad1e594aa5..1f59ef80310 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/cdc/build.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/cdc/build.en.md
@@ -86,7 +86,6 @@ authority:
# port: 6379
props:
- system-log-level: INFO
proxy-default-port: 3307 # Proxy default port.
cdc-server-port: 33071 # CDC Server port, must be configured
proxy-frontend-database-protocol-type: openGauss # Consistent with the type of backend database
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.cn.md
index cf89ae7b01c..bee22a6cf5b 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.cn.md
@@ -36,8 +36,6 @@ agentPluginsEnabled ::=
- `agent_plugins_enabled` 为 `agent` 插件的启用状态,默认值 `FALSE`
-- `system_log_level` 为 系统日志等级,仅影响 `PROXY` 的日志打印,默认值 `INFO`
-
### 示例
- 设置 `Proxy` 属性配置
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.en.md
index db7d049a83c..717c3340bb4 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/set-dist-vairable.en.md
@@ -35,8 +35,6 @@ agentPluginsEnabled ::=
- `agent_plugins_enabled` is use to set the `agent` plugins enable status, the default value is `FALSE`
-- `system_log_level` is the system log level, only affects the log printing of `PROXY`, the default value is `INFO`
-
### Example
- Set property configuration of `Proxy`
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.cn.md
index 45411d2d2dd..74b0041cb7c 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.cn.md
@@ -48,31 +48,31 @@ SHOW DIST VARIABLES;
```sql
mysql> SHOW DIST VARIABLES;
-+---------------------------------------+-----------------+
-| variable_name | variable_value |
-+---------------------------------------+-----------------+
-| agent_plugins_enabled | true |
-| cached_connections | 0 |
-| cdc_server_port | 33071 |
-| check_table_metadata_enabled | false |
-| kernel_executor_size | 0 |
-| max_connections_size_per_query | 1 |
-| proxy_backend_query_fetch_size | -1 |
-| proxy_default_port | 3307 |
-| proxy_frontend_database_protocol_type | |
-| proxy_frontend_executor_size | 0 |
-| proxy_frontend_flush_threshold | 128 |
-| proxy_frontend_max_connections | 0 |
-| proxy_frontend_ssl_cipher | |
-| proxy_frontend_ssl_enabled | false |
-| proxy_frontend_ssl_version | TLSv1.2,TLSv1.3 |
-| proxy_meta_data_collector_enabled | true |
-| proxy_netty_backlog | 1024 |
-| sql_federation_type | NONE |
-| sql_show | false |
-| sql_simple | false |
-| system_log_level | INFO |
-+---------------------------------------+-----------------+
++-----------------------------------------+-----------------+
+| variable_name | variable_value |
++-----------------------------------------+-----------------+
+| agent_plugins_enabled | true |
+| cached_connections | 0 |
+| cdc_server_port | 33071 |
+| check_table_metadata_enabled | false |
+| kernel_executor_size | 0 |
+| load_table_metadata_batch_size | 1000 |
+| max_connections_size_per_query | 1 |
+| proxy_backend_query_fetch_size | -1 |
+| proxy_default_port | 3307 |
+| proxy_frontend_database_protocol_type | |
+| proxy_frontend_executor_size | 0 |
+| proxy_frontend_flush_threshold | 128 |
+| proxy_frontend_max_connections | 0 |
+| proxy_frontend_ssl_cipher | |
+| proxy_frontend_ssl_enabled | false |
+| proxy_frontend_ssl_version | TLSv1.2,TLSv1.3 |
+| proxy_meta_data_collector_enabled | false |
+| proxy_netty_backlog | 1024 |
+| sql_show | false |
+| sql_simple | false |
+| system_schema_metadata_assembly_enabled | true |
++-----------------------------------------+-----------------+
21 rows in set (0.01 sec)
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.en.md
index bee927faa71..dca3090981d 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/show-dist-variable.en.md
@@ -48,31 +48,31 @@ SHOW DIST VARIABLES;
```sql
mysql> SHOW DIST VARIABLES;
-+---------------------------------------+-----------------+
-| variable_name | variable_value |
-+---------------------------------------+-----------------+
-| agent_plugins_enabled | true |
-| cached_connections | 0 |
-| cdc_server_port | 33071 |
-| check_table_metadata_enabled | false |
-| kernel_executor_size | 0 |
-| max_connections_size_per_query | 1 |
-| proxy_backend_query_fetch_size | -1 |
-| proxy_default_port | 3307 |
-| proxy_frontend_database_protocol_type | |
-| proxy_frontend_executor_size | 0 |
-| proxy_frontend_flush_threshold | 128 |
-| proxy_frontend_max_connections | 0 |
-| proxy_frontend_ssl_cipher | |
-| proxy_frontend_ssl_enabled | false |
-| proxy_frontend_ssl_version | TLSv1.2,TLSv1.3 |
-| proxy_meta_data_collector_enabled | true |
-| proxy_netty_backlog | 1024 |
-| sql_federation_type | NONE |
-| sql_show | false |
-| sql_simple | false |
-| system_log_level | INFO |
-+---------------------------------------+-----------------+
++-----------------------------------------+-----------------+
+| variable_name | variable_value |
++-----------------------------------------+-----------------+
+| agent_plugins_enabled | true |
+| cached_connections | 0 |
+| cdc_server_port | 33071 |
+| check_table_metadata_enabled | false |
+| kernel_executor_size | 0 |
+| load_table_metadata_batch_size | 1000 |
+| max_connections_size_per_query | 1 |
+| proxy_backend_query_fetch_size | -1 |
+| proxy_default_port | 3307 |
+| proxy_frontend_database_protocol_type | |
+| proxy_frontend_executor_size | 0 |
+| proxy_frontend_flush_threshold | 128 |
+| proxy_frontend_max_connections | 0 |
+| proxy_frontend_ssl_cipher | |
+| proxy_frontend_ssl_enabled | false |
+| proxy_frontend_ssl_version | TLSv1.2,TLSv1.3 |
+| proxy_meta_data_collector_enabled | false |
+| proxy_netty_backlog | 1024 |
+| sql_show | false |
+| sql_simple | false |
+| system_schema_metadata_assembly_enabled | true |
++-----------------------------------------+-----------------+
21 rows in set (0.01 sec)
```
- Query specified system variable configuration of `PROXY`
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
index 4dfb2a24e62..63e0555e3da 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
@@ -12,7 +12,6 @@ Apache ShardingSphere 提供了丰富的系统配置属性,用户可通过 `gl
| *名称* | *数据类型* | *说明* | *默认值* | *动态生效* |
|-------------------------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------|-----------------|--------|
-| system-log-level (?) | String | 系统日志输出级别,支持 DEBUG、INFO、WARN 和 ERROR,默认级别是 INFO。 | INFO | 是 |
| sql-show (?) | boolean | 是否在日志中打印 SQL。 <br /> 打印 SQL 可以帮助开发者快速定位系统问题。日志内容包含:逻辑 SQL,真实 SQL 和 SQL 解析结果。<br /> 如果开启配置,日志将使用 Topic `ShardingSphere-SQL`,日志级别是 INFO。 | false | 是 |
| sql-simple (?) | boolean | 是否在日志中打印简单风格的 SQL。 | false | 是 |
| kernel-executor-size (?) | int | 用于设置任务处理线程池的大小。每个 ShardingSphereDataSource 使用一个独立的线程池,同一个 JVM 的不同数据源不共享线程池。 | infinite | 否 |
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
index 4c31284cf61..d8b31b09803 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
@@ -12,7 +12,6 @@ Apache ShardingSphere provides a wealth of system configuration properties, whic
| *Name* | *Data Type* | *Description* | *Default* | *Dynamic Update* |
|-------------------------------------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|------------------|
-| system-log-level (?) | String | System log output level, supports DEBUG, INFO, WARN and ERROR, the default level is INFO. | INFO | True |
| sql-show (?) | boolean | Whether to print SQL in logs. <br /> Printing SQL can help developers quickly locate system problems. Logs contain the following contents: logical SQL, authentic SQL and SQL parsing result. <br /> If configuration is enabled, logs will use Topic `ShardingSphere-SQL`, and log level is INFO. | false | True |
| sql-simple (?) | boolean | Whether to print simple SQL in logs. | false | True |
| kernel-executor-size (?) | int | Set the size of the thread pool for task processing. Each ShardingSphereDataSource uses an independent thread pool, and different data sources on the same JVM do not share thread pools. | infinite | False |
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
index b625aff6252..23031dd5bc2 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
@@ -21,7 +21,6 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.props.TypedPropertyKey;
-import org.slf4j.event.Level;
import java.util.Arrays;
import java.util.Collection;
@@ -34,11 +33,6 @@ import java.util.stream.Collectors;
@Getter
public enum ConfigurationPropertyKey implements TypedPropertyKey {
- /**
- * The system log level.
- */
- SYSTEM_LOG_LEVEL("system-log-level", Level.INFO.toString(), Level.class, false),
-
/**
* Whether show SQL in log.
*/
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
index 3b88daf8adc..430ca2a62ed 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertiesTest.java
@@ -22,7 +22,6 @@ import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;
import org.junit.jupiter.api.Test;
-import org.slf4j.event.Level;
import java.util.Properties;
@@ -37,7 +36,6 @@ class ConfigurationPropertiesTest {
@Test
void assertGetValue() {
ConfigurationProperties actual = new ConfigurationProperties(createProperties());
- assertThat(actual.getValue(ConfigurationPropertyKey.SYSTEM_LOG_LEVEL), is(Level.DEBUG));
assertTrue((Boolean) actual.getValue(ConfigurationPropertyKey.SQL_SHOW));
assertTrue((Boolean) actual.getValue(ConfigurationPropertyKey.SQL_SIMPLE));
assertThat(actual.getValue(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE), is(20));
@@ -55,7 +53,6 @@ class ConfigurationPropertiesTest {
private Properties createProperties() {
return PropertiesBuilder.build(
- new Property(ConfigurationPropertyKey.SYSTEM_LOG_LEVEL.getKey(), Level.DEBUG.toString()),
new Property(ConfigurationPropertyKey.SQL_SHOW.getKey(), Boolean.TRUE.toString()),
new Property(ConfigurationPropertyKey.SQL_SIMPLE.getKey(), Boolean.TRUE.toString()),
new Property(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE.getKey(), "20"),
@@ -74,7 +71,6 @@ class ConfigurationPropertiesTest {
@Test
void assertGetDefaultValue() {
ConfigurationProperties actual = new ConfigurationProperties(new Properties());
- assertThat(actual.getValue(ConfigurationPropertyKey.SYSTEM_LOG_LEVEL), is(Level.INFO));
assertFalse((Boolean) actual.getValue(ConfigurationPropertyKey.SQL_SHOW));
assertFalse((Boolean) actual.getValue(ConfigurationPropertyKey.SQL_SIMPLE));
assertThat(actual.getValue(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE), is(0));
diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/ShardingSpherePipelineDataSourceCreator.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
index 23412251054..ef569c98b5f 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
@@ -70,7 +70,7 @@ public final class ShardingSpherePipelineDataSourceCreator implements PipelineDa
private void updateConfigurationProperties(final YamlRootConfiguration yamlRootConfig) {
Properties newProps = new Properties();
- for (String each : Arrays.asList(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE.getKey(), ConfigurationPropertyKey.SYSTEM_LOG_LEVEL.getKey(), ConfigurationPropertyKey.SQL_SHOW.getKey())) {
+ for (String each : Arrays.asList(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE.getKey(), ConfigurationPropertyKey.SQL_SHOW.getKey())) {
Object value = yamlRootConfig.getProps().get(each);
if (null != value) {
newProps.put(each, value);
diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutor.java
index 314f19643fe..3cb93c62a6c 100644
--- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutor.java
+++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutor.java
@@ -17,9 +17,6 @@
package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.updatable.variable;
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.LoggerContext;
import org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecutor;
import org.apache.shardingsphere.distsql.statement.ral.updatable.SetDistVariableStatement;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
@@ -33,7 +30,6 @@ import org.apache.shardingsphere.infra.props.exception.TypedPropertyValueExcepti
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.metadata.MetaDataContexts;
-import org.slf4j.LoggerFactory;
import java.sql.SQLException;
import java.util.Properties;
@@ -68,7 +64,6 @@ public final class SetDistVariableExecutor implements DistSQLUpdateExecutor<SetD
props.putAll(metaDataContexts.getMetaData().getTemporaryProps().getProps());
props.put(propertyKey.getKey(), getValue(propertyKey, value));
contextManager.getPersistServiceFacade().getModeFacade().getMetaDataManagerService().alterProperties(props);
- refreshRootLogger(props);
}
private Object getValue(final TypedPropertyKey propertyKey, final String value) {
@@ -83,16 +78,6 @@ public final class SetDistVariableExecutor implements DistSQLUpdateExecutor<SetD
}
}
- private void refreshRootLogger(final Properties props) {
- LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
- Logger rootLogger = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);
- renewRootLoggerLevel(rootLogger, props);
- }
-
- private void renewRootLoggerLevel(final Logger rootLogger, final Properties props) {
- rootLogger.setLevel(Level.valueOf(props.getOrDefault(ConfigurationPropertyKey.SYSTEM_LOG_LEVEL.getKey(), ConfigurationPropertyKey.SYSTEM_LOG_LEVEL.getDefaultValue()).toString()));
- }
-
@Override
public Class<SetDistVariableStatement> getType() {
return SetDistVariableStatement.class;
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/variable/ShowDistVariablesExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/variable/ShowDistVariablesExecutorTest.java
index 705adbfc276..d890bdef4e7 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/variable/ShowDistVariablesExecutorTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/variable/ShowDistVariablesExecutorTest.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.proxy.backend.handler.distsql.ral.queryable.va
import org.apache.shardingsphere.distsql.handler.engine.DistSQLConnectionContext;
import org.apache.shardingsphere.distsql.statement.ral.queryable.show.ShowDistVariablesStatement;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.config.props.temporary.TemporaryConfigurationProperties;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.executor.sql.prepare.driver.DatabaseConnectionManager;
import org.apache.shardingsphere.infra.executor.sql.prepare.driver.ExecutorStatementManager;
@@ -46,24 +45,19 @@ class ShowDistVariablesExecutorTest {
@Test
void assertExecute() {
- when(contextManager.getMetaDataContexts().getMetaData().getProps()).thenReturn(new ConfigurationProperties(PropertiesBuilder.build(new Property("system-log-level", "INFO"))));
- when(contextManager.getMetaDataContexts().getMetaData().getTemporaryProps())
- .thenReturn(new TemporaryConfigurationProperties(PropertiesBuilder.build(new Property("proxy-meta-data-collector-enabled", Boolean.FALSE.toString()))));
+ when(contextManager.getMetaDataContexts().getMetaData().getProps()).thenReturn(new ConfigurationProperties(PropertiesBuilder.build(new Property("agent-plugins-enabled", "false"))));
ShowDistVariablesExecutor executor = new ShowDistVariablesExecutor();
executor.setConnectionContext(new DistSQLConnectionContext(mock(QueryContext.class), 1,
mock(DatabaseType.class), mock(DatabaseConnectionManager.class), mock(ExecutorStatementManager.class)));
Collection<LocalDataQueryResultRow> actual = executor.getRows(mock(ShowDistVariablesStatement.class), contextManager);
- assertThat(actual.size(), is(22));
+ assertThat(actual.size(), is(21));
LocalDataQueryResultRow row = actual.iterator().next();
assertThat(row.getCell(1), is("agent_plugins_enabled"));
- assertThat(row.getCell(2), is("true"));
+ assertThat(row.getCell(2), is("false"));
}
@Test
void assertExecuteWithLike() {
- when(contextManager.getMetaDataContexts().getMetaData().getProps()).thenReturn(new ConfigurationProperties(PropertiesBuilder.build(new Property("system-log-level", "INFO"))));
- when(contextManager.getMetaDataContexts().getMetaData().getTemporaryProps())
- .thenReturn(new TemporaryConfigurationProperties(PropertiesBuilder.build(new Property("proxy-meta-data-collector-enabled", Boolean.FALSE.toString()))));
ShowDistVariablesExecutor executor = new ShowDistVariablesExecutor();
executor.setConnectionContext(new DistSQLConnectionContext(mock(QueryContext.class), 1,
mock(DatabaseType.class), mock(DatabaseConnectionManager.class), mock(ExecutorStatementManager.class)));
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutorTest.java
index 095026e7bfe..482a03222d2 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutorTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutorTest.java
@@ -22,7 +22,6 @@ import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.config.props.temporary.TemporaryConfigurationPropertyKey;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
-import org.apache.shardingsphere.infra.exception.kernel.syntax.InvalidVariableValueException;
import org.apache.shardingsphere.infra.instance.ComputeNodeInstance;
import org.apache.shardingsphere.infra.instance.ComputeNodeInstanceContext;
import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
@@ -39,13 +38,11 @@ import org.apache.shardingsphere.test.mock.AutoMockExtension;
import org.apache.shardingsphere.test.mock.StaticMockSettings;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
-import org.slf4j.event.Level;
import java.sql.SQLException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -86,23 +83,6 @@ class SetDistVariableExecutorTest {
assertThat(((DatabaseType) contextManager.getMetaDataContexts().getMetaData().getProps().getValue(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE)).getType(), is("FIXTURE"));
}
- @Test
- void assertExecuteWithSystemLogLevel() throws SQLException {
- SetDistVariableStatement statement = new SetDistVariableStatement("system_log_level", "debug");
- ContextManager contextManager = mockContextManager();
- executor.executeUpdate(statement, contextManager);
- Object actualValue = contextManager.getMetaDataContexts().getMetaData().getProps().getProps().get("system-log-level");
- assertThat(actualValue.toString(), is("DEBUG"));
- assertThat(contextManager.getMetaDataContexts().getMetaData().getProps().getValue(ConfigurationPropertyKey.SYSTEM_LOG_LEVEL), is(Level.DEBUG));
- }
-
- @Test
- void assertExecuteWithWrongSystemLogLevel() {
- ContextManager contextManager = mockContextManager();
- SetDistVariableStatement statement = new SetDistVariableStatement("system_log_level", "invalid");
- assertThrows(InvalidVariableValueException.class, () -> executor.executeUpdate(statement, contextManager));
- }
-
private ContextManager mockContextManager() {
MetaDataPersistFacade metaDataPersistFacade = mock(MetaDataPersistFacade.class, RETURNS_DEEP_STUBS);
when(metaDataPersistFacade.getPropsService()).thenReturn(mock(PropertiesPersistService.class));
diff --git a/proxy/bootstrap/src/main/resources/conf/logback.xml b/proxy/bootstrap/src/main/resources/logback.xml
similarity index 98%
rename from proxy/bootstrap/src/main/resources/conf/logback.xml
rename to proxy/bootstrap/src/main/resources/logback.xml
index 98875960915..55ea59f1135 100644
--- a/proxy/bootstrap/src/main/resources/conf/logback.xml
+++ b/proxy/bootstrap/src/main/resources/logback.xml
@@ -22,16 +22,17 @@
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>
</encoder>
</appender>
+
<logger name="org.apache.shardingsphere" level="info" additivity="false">
<appender-ref ref="console" />
</logger>
-
+
<logger name="com.zaxxer.hikari" level="error" />
-
+
<logger name="com.atomikos" level="error" />
-
+
<logger name="io.netty" level="error" />
-
+
<root>
<level value="info" />
<appender-ref ref="console" />
diff --git a/test/e2e/sql/src/test/resources/cases/ral/dataset/empty_rules/show_dist_variables.xml b/test/e2e/sql/src/test/resources/cases/ral/dataset/empty_rules/show_dist_variables.xml
index ae994915738..bfbf2494b1a 100644
--- a/test/e2e/sql/src/test/resources/cases/ral/dataset/empty_rules/show_dist_variables.xml
+++ b/test/e2e/sql/src/test/resources/cases/ral/dataset/empty_rules/show_dist_variables.xml
@@ -40,6 +40,5 @@
<row values="proxy_netty_backlog| 1024" />
<row values="sql_show| false" />
<row values="sql_simple| false" />
- <row values="system_log_level| INFO" />
<row values="system_schema_metadata_assembly_enabled| true" />
</dataset>