From a77f6ccb69e47eeb99fe49c81796c918a0df8530 Mon Sep 17 00:00:00 2001 From: StrikeW Date: Sat, 11 Mar 2023 21:27:45 +0800 Subject: [PATCH] fix(connector): fix logging after bump to log4j2 (#8487) --- .../risingwave-connector-service/pom.xml | 4 ++-- .../src/main/resources/log4j.properties | 14 -------------- .../src/main/resources/log4j2.properties | 12 ++++++++++++ .../risingwave-sink-deltalake/pom.xml | 4 ++-- .../connector-node/risingwave-sink-iceberg/pom.xml | 4 ++-- java/connector-node/risingwave-sink-jdbc/pom.xml | 4 ++-- java/pom.xml | 7 +++---- 7 files changed, 23 insertions(+), 26 deletions(-) delete mode 100644 java/connector-node/risingwave-connector-service/src/main/resources/log4j.properties create mode 100644 java/connector-node/risingwave-connector-service/src/main/resources/log4j2.properties diff --git a/java/connector-node/risingwave-connector-service/pom.xml b/java/connector-node/risingwave-connector-service/pom.xml index 89a02597ef352..ff38088c4221f 100644 --- a/java/connector-node/risingwave-connector-service/pom.xml +++ b/java/connector-node/risingwave-connector-service/pom.xml @@ -32,8 +32,8 @@ - org.slf4j - slf4j-api + org.apache.logging.log4j + log4j-api org.apache.logging.log4j diff --git a/java/connector-node/risingwave-connector-service/src/main/resources/log4j.properties b/java/connector-node/risingwave-connector-service/src/main/resources/log4j.properties deleted file mode 100644 index e9584531b5ed3..0000000000000 --- a/java/connector-node/risingwave-connector-service/src/main/resources/log4j.properties +++ /dev/null @@ -1,14 +0,0 @@ -log4j.rootLogger=info, stdout, fout -log4j.logger.com.risingwave=info - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.EnhancedPatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] %c{2}:%L - %m%n - -log4j.appender.fout=org.apache.log4j.DailyRollingFileAppender -log4j.appender.fout.File=connector-node.log -log4j.appender.fout.ImmediateFlush=true -log4j.appender.fout.Append=true -log4j.appender.fout.DatePattern='.'yyyy-MM-dd -log4j.appender.fout.layout=org.apache.log4j.EnhancedPatternLayout -log4j.appender.fout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] %c{2}:%L - %m%n diff --git a/java/connector-node/risingwave-connector-service/src/main/resources/log4j2.properties b/java/connector-node/risingwave-connector-service/src/main/resources/log4j2.properties new file mode 100644 index 0000000000000..55c02dece2c36 --- /dev/null +++ b/java/connector-node/risingwave-connector-service/src/main/resources/log4j2.properties @@ -0,0 +1,12 @@ +rootLogger.level = INFO +# declare the appender to use +appenders = console + +# appender properties +appender.console.type = Console +appender.console.name = stdout +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] %c{2}:%L - %m%n + +rootLogger.appenderRefs = console +rootLogger.appenderRef.console.ref = stdout diff --git a/java/connector-node/risingwave-sink-deltalake/pom.xml b/java/connector-node/risingwave-sink-deltalake/pom.xml index 71e4f182d1a44..cbb28db6e2ce2 100644 --- a/java/connector-node/risingwave-sink-deltalake/pom.xml +++ b/java/connector-node/risingwave-sink-deltalake/pom.xml @@ -68,8 +68,8 @@ - org.slf4j - slf4j-api + org.apache.logging.log4j + log4j-api org.apache.logging.log4j diff --git a/java/connector-node/risingwave-sink-iceberg/pom.xml b/java/connector-node/risingwave-sink-iceberg/pom.xml index 0d8567d5a3136..af7478e35a6be 100644 --- a/java/connector-node/risingwave-sink-iceberg/pom.xml +++ b/java/connector-node/risingwave-sink-iceberg/pom.xml @@ -104,8 +104,8 @@ test - org.slf4j - slf4j-api + org.apache.logging.log4j + log4j-api org.apache.logging.log4j diff --git a/java/connector-node/risingwave-sink-jdbc/pom.xml b/java/connector-node/risingwave-sink-jdbc/pom.xml index 1b6ca9de1e962..65c59aa7c3b5e 100644 --- a/java/connector-node/risingwave-sink-jdbc/pom.xml +++ b/java/connector-node/risingwave-sink-jdbc/pom.xml @@ -23,8 +23,8 @@ connector-api - org.slf4j - slf4j-api + org.apache.logging.log4j + log4j-api org.apache.logging.log4j diff --git a/java/pom.xml b/java/pom.xml index 85cc80a998c3b..fe24bacc97bf1 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -31,7 +31,6 @@ 2.10 1.0-SNAPSHOT 2.27.1 - 1.7.36 2.20.0 1.5.0 1.9.7.Final @@ -42,9 +41,9 @@ - org.slf4j - slf4j-api - ${slf4j.version} + org.apache.logging.log4j + log4j-api + ${log4j.version} org.apache.logging.log4j