You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/06/06 13:01:18 UTC
[incubator-inlong] branch master updated: [INLONG-4292][Agent][TubeMQ][Sort] Upgrade the property file from log4j to log4j2 (#4293)
This is an automated email from the ASF dual-hosted git repository.
healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 36a79add0 [INLONG-4292][Agent][TubeMQ][Sort] Upgrade the property file from log4j to log4j2 (#4293)
36a79add0 is described below
commit 36a79add0a9693ed2009e3250d1899367dc70964
Author: thexia <37...@users.noreply.github.com>
AuthorDate: Mon Jun 6 21:01:12 2022 +0800
[INLONG-4292][Agent][TubeMQ][Sort] Upgrade the property file from log4j to log4j2 (#4293)
---
.../src/test/resources/log4j2.properties} | 9 ++++----
.../src/test/resources/log4j2.properties} | 10 ++++-----
.../agent/plugin/sources/TestTextFileReader.java | 2 +-
.../src/test/resources/log4j.properties | 21 ------------------
inlong-sort/pom.xml | 17 +--------------
.../sort/parser/IcebergNodeSqlParserTest.java | 1 -
...og4j-test.properties => log4j2-test.properties} | 21 +++++++++++-------
.../src/test/resources/log4j-test.properties | 25 ----------------------
.../src/test/resources/log4j-test.properties | 24 ---------------------
...og4j-test.properties => log4j2-test.properties} | 23 +++++++++++---------
.../apache/inlong/sort/formats/kv/KvUtilsTest.java | 1 -
.../src/test/resources/log4j-test.properties | 24 ---------------------
.../src/test/resources/log4j2-test.properties} | 8 +++----
inlong-sort/sort-formats/pom.xml | 11 ++--------
.../src/test/resources/log4j2.properties} | 10 ++++-----
.../src/test/resources/log4j2.properties} | 10 ++++-----
.../src/test/resources/log4j2.properties} | 10 ++++-----
.../src/test/resources/log4j2.properties} | 10 ++++-----
.../src/test/resources/log4j.properties | 23 --------------------
.../src/test/resources/log4j2.properties} | 9 ++++----
20 files changed, 63 insertions(+), 206 deletions(-)
diff --git a/inlong-agent/agent-core/src/test/resources/log4j.properties b/inlong-agent/agent-common/src/test/resources/log4j2.properties
similarity index 79%
rename from inlong-agent/agent-core/src/test/resources/log4j.properties
rename to inlong-agent/agent-common/src/test/resources/log4j2.properties
index a64a3b63a..bc3f23046 100644
--- a/inlong-agent/agent-core/src/test/resources/log4j.properties
+++ b/inlong-agent/agent-common/src/test/resources/log4j2.properties
@@ -14,7 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-log4j.rootLogger=INFO, out
-log4j.appender.out=org.apache.log4j.ConsoleAppender
-log4j.appender.out.layout=org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern=%d (%t) [%p - %l] %m%n
\ No newline at end of file
+rootLogger=INFO, out
+appender.out.name=out
+appender.out.type=Console
+appender.out.layout.type=PatternLayout
+appender.out.layout.pattern=%d (%t) [%p - %l] %m%n
\ No newline at end of file
diff --git a/inlong-agent/agent-common/src/test/resources/log4j.properties b/inlong-agent/agent-core/src/test/resources/log4j2.properties
similarity index 79%
rename from inlong-agent/agent-common/src/test/resources/log4j.properties
rename to inlong-agent/agent-core/src/test/resources/log4j2.properties
index 25675f6ed..bc3f23046 100644
--- a/inlong-agent/agent-common/src/test/resources/log4j.properties
+++ b/inlong-agent/agent-core/src/test/resources/log4j2.properties
@@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-
-log4j.rootLogger=INFO, out
-log4j.appender.out=org.apache.log4j.ConsoleAppender
-log4j.appender.out.layout=org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern=%d (%t) [%p - %l] %m%n
\ No newline at end of file
+rootLogger=INFO, out
+appender.out.name=out
+appender.out.type=Console
+appender.out.layout.type=PatternLayout
+appender.out.layout.pattern=%d (%t) [%p - %l] %m%n
\ No newline at end of file
diff --git a/inlong-agent/agent-plugins/src/test/java/org/apache/inlong/agent/plugin/sources/TestTextFileReader.java b/inlong-agent/agent-plugins/src/test/java/org/apache/inlong/agent/plugin/sources/TestTextFileReader.java
index 78e62a95d..18545403c 100755
--- a/inlong-agent/agent-plugins/src/test/java/org/apache/inlong/agent/plugin/sources/TestTextFileReader.java
+++ b/inlong-agent/agent-plugins/src/test/java/org/apache/inlong/agent/plugin/sources/TestTextFileReader.java
@@ -80,7 +80,7 @@ public class TestTextFileReader {
@Test
public void testStreamClose() throws Exception {
Path uri = Paths.get(Objects.requireNonNull(
- getClass().getClassLoader().getResource("log4j.properties")).toURI());
+ getClass().getClassLoader().getResource("agent.properties")).toURI());
Stream<String> stream = null;
BufferedReader reader = null;
try {
diff --git a/inlong-agent/agent-plugins/src/test/resources/log4j.properties b/inlong-agent/agent-plugins/src/test/resources/log4j.properties
deleted file mode 100644
index 25675f6ed..000000000
--- a/inlong-agent/agent-plugins/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# 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.
-#
-
-log4j.rootLogger=INFO, out
-log4j.appender.out=org.apache.log4j.ConsoleAppender
-log4j.appender.out.layout=org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern=%d (%t) [%p - %l] %m%n
\ No newline at end of file
diff --git a/inlong-sort/pom.xml b/inlong-sort/pom.xml
index fe65425de..f4deb44e9 100644
--- a/inlong-sort/pom.xml
+++ b/inlong-sort/pom.xml
@@ -72,21 +72,6 @@
</dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-1.2-api</artifactId>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -147,7 +132,7 @@
<configuration>
<!-- Enforce single fork execution due to heavy mini cluster use in the tests -->
<forkCount>1</forkCount>
- <argLine>-Xms256m -Xmx1024m -Dlog4j.configuration=${log4j.configuration}
+ <argLine>-Xms256m -Xmx1024m -Dlog4j.configurationFile=${log4j.configurationfile}
-Dmvn.forkNumber=${surefire.forkNumber} -XX:-UseGCOverheadLimit
</argLine>
</configuration>
diff --git a/inlong-sort/sort-core/src/test/java/org/apache/inlong/sort/parser/IcebergNodeSqlParserTest.java b/inlong-sort/sort-core/src/test/java/org/apache/inlong/sort/parser/IcebergNodeSqlParserTest.java
index 565d32633..80b089059 100644
--- a/inlong-sort/sort-core/src/test/java/org/apache/inlong/sort/parser/IcebergNodeSqlParserTest.java
+++ b/inlong-sort/sort-core/src/test/java/org/apache/inlong/sort/parser/IcebergNodeSqlParserTest.java
@@ -52,7 +52,6 @@ import java.util.stream.Collectors;
* Test for Iceberg SQL parser.
*/
public class IcebergNodeSqlParserTest extends AbstractTestBase {
-
private MySqlExtractNode buildMySQLExtractNode(String id) {
List<FieldInfo> fields = Arrays.asList(new FieldInfo("id", new LongFormatInfo()),
new FieldInfo("name", new StringFormatInfo()),
diff --git a/inlong-sort/sort-core/src/test/resources/log4j-test.properties b/inlong-sort/sort-core/src/test/resources/log4j2-test.properties
similarity index 63%
rename from inlong-sort/sort-core/src/test/resources/log4j-test.properties
rename to inlong-sort/sort-core/src/test/resources/log4j2-test.properties
index 840146c96..9abf50d05 100644
--- a/inlong-sort/sort-core/src/test/resources/log4j-test.properties
+++ b/inlong-sort/sort-core/src/test/resources/log4j2-test.properties
@@ -16,13 +16,18 @@
# specific language governing permissions and limitations
# under the License.
#
-log4j.rootLogger=INFO, testlogger
-# testlogger is set to be a ConsoleAppender.
-log4j.appender.testlogger=org.apache.log4j.ConsoleAppender
-log4j.appender.testlogger.target=System.err
-log4j.appender.testlogger.layout=org.apache.log4j.PatternLayout
-log4j.appender.testlogger.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+rootLogger=INFO, testlogger
+
+appender.out.type=Console
+appender.out.name=testlogger
+appender.out.layout.type=PatternLayout
+appender.out.layout.pattern=%-4r [%t] %-5p %c %x - %m%n
+
# Suppress the irrelevant (wrong) warnings from the Netty channel handler
-log4j.logger.org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline=ERROR, testlogger
+logger.flinknetty=ERROR, testlogger
+logger.flinknetty.name=org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
+logger.flinknetty.additivity=false
# Resource leak detector only works with logging enabled at error level
-log4j.logger.org.apache.flink.shaded.netty4.io.netty.util.ResourceLeakDetector=ERROR, testlogger
+logger.leakdetector=ERROR, testlogger
+logger.leakdetector.name=org.apache.flink.shaded.netty4.io.netty.util.ResourceLeakDetector
+logger.leakdetector.additivity=false
diff --git a/inlong-sort/sort-formats/format-inlongmsg-base/src/test/resources/log4j-test.properties b/inlong-sort/sort-formats/format-inlongmsg-base/src/test/resources/log4j-test.properties
deleted file mode 100644
index bf052fa68..000000000
--- a/inlong-sort/sort-formats/format-inlongmsg-base/src/test/resources/log4j-test.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# /*
-# * 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.
-# */
-#
-log4j.rootLogger=OFF, A1
-# A1 is set to be a ConsoleAppender.
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
diff --git a/inlong-sort/sort-formats/format-inlongmsg-csv/src/test/resources/log4j-test.properties b/inlong-sort/sort-formats/format-inlongmsg-csv/src/test/resources/log4j-test.properties
deleted file mode 100644
index 640ee63a0..000000000
--- a/inlong-sort/sort-formats/format-inlongmsg-csv/src/test/resources/log4j-test.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.
-#
-log4j.rootLogger=OFF, A1
-# A1 is set to be a ConsoleAppender.
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
diff --git a/inlong-sort/sort-formats/format-json/src/test/resources/log4j-test.properties b/inlong-sort/sort-formats/format-json/src/test/resources/log4j2-test.properties
similarity index 62%
rename from inlong-sort/sort-formats/format-json/src/test/resources/log4j-test.properties
rename to inlong-sort/sort-formats/format-json/src/test/resources/log4j2-test.properties
index a4640f721..d493c984a 100644
--- a/inlong-sort/sort-formats/format-json/src/test/resources/log4j-test.properties
+++ b/inlong-sort/sort-formats/format-json/src/test/resources/log4j2-test.properties
@@ -15,15 +15,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
-# Set root logger level to OFF to not flood build logs
-# set manually to INFO for debugging purposes
-log4j.rootLogger=INFO, testlogger
-# testlogger is set to be a ConsoleAppender.
-log4j.appender.testlogger=org.apache.log4j.ConsoleAppender
-log4j.appender.testlogger.target=System.err
-log4j.appender.testlogger.layout=org.apache.log4j.PatternLayout
-log4j.appender.testlogger.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-4r [%t] %-5p %c %x - %m%n
+rootLogger=INFO, testlogger
+
+appender.out.type=Console
+appender.out.name=testlogger
+appender.out.layout.type=PatternLayout
+appender.out.layout.pattern=%-4r [%t] %-5p %c %x - %m%n
+
# Suppress the irrelevant (wrong) warnings from the Netty channel handler
-log4j.logger.org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline=ERROR, testlogger
+logger.flinknetty=ERROR, testlogger
+logger.flinknetty.name=org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
+logger.flinknetty.additivity=false
# Resource leak detector only works with logging enabled at error level
-log4j.logger.org.apache.flink.shaded.netty4.io.netty.util.ResourceLeakDetector=ERROR, testlogger
+logger.leakdetector=ERROR, testlogger
+logger.leakdetector.name=org.apache.flink.shaded.netty4.io.netty.util.ResourceLeakDetector
+logger.leakdetector.additivity=false
diff --git a/inlong-sort/sort-formats/format-kv/src/test/java/org/apache/inlong/sort/formats/kv/KvUtilsTest.java b/inlong-sort/sort-formats/format-kv/src/test/java/org/apache/inlong/sort/formats/kv/KvUtilsTest.java
index c2627df4f..c6c18f5a0 100644
--- a/inlong-sort/sort-formats/format-kv/src/test/java/org/apache/inlong/sort/formats/kv/KvUtilsTest.java
+++ b/inlong-sort/sort-formats/format-kv/src/test/java/org/apache/inlong/sort/formats/kv/KvUtilsTest.java
@@ -29,7 +29,6 @@ import org.junit.Test;
* Unit tests for kv splitting and concating.
*/
public class KvUtilsTest {
-
@Test
public void testSplitNormal() {
assertEquals(
diff --git a/inlong-sort/sort-formats/format-kv/src/test/resources/log4j-test.properties b/inlong-sort/sort-formats/format-kv/src/test/resources/log4j-test.properties
deleted file mode 100644
index 640ee63a0..000000000
--- a/inlong-sort/sort-formats/format-kv/src/test/resources/log4j-test.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.
-#
-log4j.rootLogger=OFF, A1
-# A1 is set to be a ConsoleAppender.
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
diff --git a/inlong-sort/sort-formats/format-csv/src/test/resources/log4j-test.properties b/inlong-sort/sort-formats/format-kv/src/test/resources/log4j2-test.properties
similarity index 78%
rename from inlong-sort/sort-formats/format-csv/src/test/resources/log4j-test.properties
rename to inlong-sort/sort-formats/format-kv/src/test/resources/log4j2-test.properties
index 640ee63a0..c38802529 100644
--- a/inlong-sort/sort-formats/format-csv/src/test/resources/log4j-test.properties
+++ b/inlong-sort/sort-formats/format-kv/src/test/resources/log4j2-test.properties
@@ -16,9 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
-log4j.rootLogger=OFF, A1
+rootLogger=info, A1
# A1 is set to be a ConsoleAppender.
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+appender.A1.name=A1
+appender.A1.type=Console
diff --git a/inlong-sort/sort-formats/pom.xml b/inlong-sort/sort-formats/pom.xml
index b09690d04..3c9f5ea6e 100644
--- a/inlong-sort/sort-formats/pom.xml
+++ b/inlong-sort/sort-formats/pom.xml
@@ -62,7 +62,7 @@
<properties>
<flink.forkCount>1C</flink.forkCount>
<flink.reuseForks>true</flink.reuseForks>
- <log4j.configuration>log4j-test.properties</log4j.configuration>
+ <log4j.configurationfile>log4j2-test.properties</log4j.configurationfile>
</properties>
<!-- override these root dependencies as 'provided', so they don't end up
@@ -123,13 +123,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <type>jar</type>
- <scope>test</scope>
- </dependency>
-
<!--flink dependency-->
<dependency>
<groupId>org.apache.flink</groupId>
@@ -185,7 +178,7 @@
<reuseForks>${flink.reuseForks}</reuseForks>
<systemPropertyVariables>
<forkNumber>0${surefire.forkNumber}</forkNumber>
- <log4j.configuration>${log4j.configuration}</log4j.configuration>
+ <log4j.configurationFile>${log4j.configurationfile}</log4j.configurationFile>
</systemPropertyVariables>
</configuration>
<executions>
diff --git a/inlong-tubemq/tubemq-connectors/tubemq-connector-flink/src/test/resources/log4j.properties b/inlong-tubemq/tubemq-client/src/test/resources/log4j2.properties
similarity index 77%
rename from inlong-tubemq/tubemq-connectors/tubemq-connector-flink/src/test/resources/log4j.properties
rename to inlong-tubemq/tubemq-client/src/test/resources/log4j2.properties
index 059e5b98b..1da9b515e 100644
--- a/inlong-tubemq/tubemq-connectors/tubemq-connector-flink/src/test/resources/log4j.properties
+++ b/inlong-tubemq/tubemq-client/src/test/resources/log4j2.properties
@@ -15,9 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
-
-log4j.rootLogger=OFF,console
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.target=System.out
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+rootLogger=info, A1
+# A1 is set to be a ConsoleAppender.
+appender.A1.name=A1
+appender.A1.type=Console
diff --git a/inlong-tubemq/tubemq-connectors/tubemq-connector-flume/src/test/resources/log4j.properties b/inlong-tubemq/tubemq-connectors/tubemq-connector-flink/src/test/resources/log4j2.properties
similarity index 77%
rename from inlong-tubemq/tubemq-connectors/tubemq-connector-flume/src/test/resources/log4j.properties
rename to inlong-tubemq/tubemq-connectors/tubemq-connector-flink/src/test/resources/log4j2.properties
index 059e5b98b..1da9b515e 100644
--- a/inlong-tubemq/tubemq-connectors/tubemq-connector-flume/src/test/resources/log4j.properties
+++ b/inlong-tubemq/tubemq-connectors/tubemq-connector-flink/src/test/resources/log4j2.properties
@@ -15,9 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
-
-log4j.rootLogger=OFF,console
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.target=System.out
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+rootLogger=info, A1
+# A1 is set to be a ConsoleAppender.
+appender.A1.name=A1
+appender.A1.type=Console
diff --git a/inlong-tubemq/tubemq-core/src/test/resources/log4j.properties b/inlong-tubemq/tubemq-connectors/tubemq-connector-flume/src/test/resources/log4j2.properties
similarity index 77%
rename from inlong-tubemq/tubemq-core/src/test/resources/log4j.properties
rename to inlong-tubemq/tubemq-connectors/tubemq-connector-flume/src/test/resources/log4j2.properties
index 059e5b98b..1da9b515e 100644
--- a/inlong-tubemq/tubemq-core/src/test/resources/log4j.properties
+++ b/inlong-tubemq/tubemq-connectors/tubemq-connector-flume/src/test/resources/log4j2.properties
@@ -15,9 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
-
-log4j.rootLogger=OFF,console
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.target=System.out
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+rootLogger=info, A1
+# A1 is set to be a ConsoleAppender.
+appender.A1.name=A1
+appender.A1.type=Console
diff --git a/inlong-tubemq/tubemq-client/src/test/resources/log4j.properties b/inlong-tubemq/tubemq-core/src/test/resources/log4j2.properties
similarity index 77%
copy from inlong-tubemq/tubemq-client/src/test/resources/log4j.properties
copy to inlong-tubemq/tubemq-core/src/test/resources/log4j2.properties
index 059e5b98b..1da9b515e 100644
--- a/inlong-tubemq/tubemq-client/src/test/resources/log4j.properties
+++ b/inlong-tubemq/tubemq-core/src/test/resources/log4j2.properties
@@ -15,9 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
-
-log4j.rootLogger=OFF,console
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.target=System.out
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+rootLogger=info, A1
+# A1 is set to be a ConsoleAppender.
+appender.A1.name=A1
+appender.A1.type=Console
diff --git a/inlong-tubemq/tubemq-server/src/test/resources/log4j.properties b/inlong-tubemq/tubemq-server/src/test/resources/log4j.properties
deleted file mode 100644
index 059e5b98b..000000000
--- a/inlong-tubemq/tubemq-server/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# 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.
-################################################################################
-
-log4j.rootLogger=OFF,console
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.target=System.out
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
diff --git a/inlong-tubemq/tubemq-client/src/test/resources/log4j.properties b/inlong-tubemq/tubemq-server/src/test/resources/log4j2.properties
similarity index 77%
rename from inlong-tubemq/tubemq-client/src/test/resources/log4j.properties
rename to inlong-tubemq/tubemq-server/src/test/resources/log4j2.properties
index 059e5b98b..fc1cbfd26 100644
--- a/inlong-tubemq/tubemq-client/src/test/resources/log4j.properties
+++ b/inlong-tubemq/tubemq-server/src/test/resources/log4j2.properties
@@ -16,8 +16,7 @@
# limitations under the License.
################################################################################
-log4j.rootLogger=OFF,console
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.target=System.out
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
+rootLogger=info, A1
+# A1 is set to be a ConsoleAppender.
+appender.A1.name=A1
+appender.A1.type=Console