From e51095edaa783a8d28cec71c51f7367623d6062e Mon Sep 17 00:00:00 2001 From: ITzhangqiang Date: Wed, 11 Oct 2023 21:41:22 +0800 Subject: [PATCH] [KYUUBI #5365] Don't use Log4j2's extended throwable conversion pattern in default logging configurations ### _Why are the changes needed?_ The Apache Spark Community found a performance regression with log4j2. See https://github.com/apache/spark/pull/36747. This PR to fix the performance issue on our side. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request ### _Was this patch authored or co-authored using generative AI tooling?_ No. Closes #5400 from ITzhangqiang/KYUUBI_5365. Closes #5365 dbb9d8b32 [ITzhangqiang] [KYUUBI #5365] Don't use Log4j2's extended throwable conversion pattern in default logging configurations Authored-by: ITzhangqiang Signed-off-by: Cheng Pan --- conf/log4j2.xml.template | 6 +++--- docker/playground/conf/kyuubi-log4j2.xml | 2 +- docs/monitor/logging.md | 2 +- .../src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/scala/resources/log4j2-test.xml | 4 ++-- .../kyuubi-spark-authz/src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-spark-lineage/src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-chat-engine/src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-jdbc-engine/src/test/resources/log4j2-test.xml | 4 ++-- .../src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-trino-engine/src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-flink-it/src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-hive-it/src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-jdbc-it/src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-kubernetes-it/src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-trino-it/src/test/resources/log4j2-test.xml | 4 ++-- .../kyuubi-zookeeper-it/src/test/resources/log4j2-test.xml | 4 ++-- kyuubi-common/src/main/resources/log4j2-defaults.xml | 2 +- .../apache/kyuubi/operation/log/Log4j2DivertAppender.scala | 2 +- kyuubi-common/src/test/resources/log4j2-test.xml | 4 ++-- kyuubi-ctl/src/test/resources/log4j2-test.xml | 4 ++-- kyuubi-events/src/test/resources/log4j2-test.xml | 4 ++-- kyuubi-ha/src/test/resources/log4j2-test.xml | 4 ++-- kyuubi-hive-jdbc/src/test/resources/log4j2-test.xml | 4 ++-- kyuubi-metrics/src/test/resources/log4j2-test.xml | 4 ++-- kyuubi-rest-client/src/test/resources/log4j2-test.xml | 4 ++-- kyuubi-server/src/test/resources/log4j2-test.xml | 6 +++--- kyuubi-zookeeper/src/test/resources/log4j2-test.xml | 4 ++-- 37 files changed, 72 insertions(+), 72 deletions(-) diff --git a/conf/log4j2.xml.template b/conf/log4j2.xml.template index 86f9459a1..4139b7dbe 100644 --- a/conf/log4j2.xml.template +++ b/conf/log4j2.xml.template @@ -30,14 +30,14 @@ - + - + @@ -45,7 +45,7 @@ - + diff --git a/docker/playground/conf/kyuubi-log4j2.xml b/docker/playground/conf/kyuubi-log4j2.xml index 6aedf7652..313c121bc 100644 --- a/docker/playground/conf/kyuubi-log4j2.xml +++ b/docker/playground/conf/kyuubi-log4j2.xml @@ -22,7 +22,7 @@ - + diff --git a/docs/monitor/logging.md b/docs/monitor/logging.md index 24a5a88d6..9dce6e22a 100644 --- a/docs/monitor/logging.md +++ b/docs/monitor/logging.md @@ -114,7 +114,7 @@ For example, we can disable the console appender and enable the file appender li - + diff --git a/extensions/spark/kyuubi-extension-spark-3-3/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-extension-spark-3-3/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-extension-spark-3-3/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-extension-spark-3-3/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-extension-spark-3-4/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-extension-spark-3-4/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-extension-spark-3-4/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-extension-spark-3-4/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-extension-spark-3-5/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-extension-spark-3-5/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-extension-spark-3-5/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-extension-spark-3-5/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-extension-spark-common/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-extension-spark-common/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-extension-spark-common/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-extension-spark-common/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-extension-spark-jdbc-dialect/src/test/scala/resources/log4j2-test.xml b/extensions/spark/kyuubi-extension-spark-jdbc-dialect/src/test/scala/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-extension-spark-jdbc-dialect/src/test/scala/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-extension-spark-jdbc-dialect/src/test/scala/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-spark-authz/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-spark-authz/src/test/resources/log4j2-test.xml index 5e01ed4ab..7aaf820ad 100644 --- a/extensions/spark/kyuubi-spark-authz/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-spark-authz/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-spark-connector-common/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-spark-connector-common/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-spark-connector-common/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-spark-connector-common/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-spark-connector-hive/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-spark-connector-hive/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-spark-connector-hive/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-spark-connector-hive/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-spark-connector-tpcds/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-spark-connector-tpcds/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-spark-connector-tpcds/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-spark-connector-tpcds/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-spark-connector-tpch/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-spark-connector-tpch/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-spark-connector-tpch/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-spark-connector-tpch/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/extensions/spark/kyuubi-spark-lineage/src/test/resources/log4j2-test.xml b/extensions/spark/kyuubi-spark-lineage/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/extensions/spark/kyuubi-spark-lineage/src/test/resources/log4j2-test.xml +++ b/extensions/spark/kyuubi-spark-lineage/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/externals/kyuubi-chat-engine/src/test/resources/log4j2-test.xml b/externals/kyuubi-chat-engine/src/test/resources/log4j2-test.xml index 585a12c6f..356d64590 100644 --- a/externals/kyuubi-chat-engine/src/test/resources/log4j2-test.xml +++ b/externals/kyuubi-chat-engine/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/externals/kyuubi-flink-sql-engine/src/test/resources/log4j2-test.xml b/externals/kyuubi-flink-sql-engine/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/externals/kyuubi-flink-sql-engine/src/test/resources/log4j2-test.xml +++ b/externals/kyuubi-flink-sql-engine/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/externals/kyuubi-hive-sql-engine/src/test/resources/log4j2-test.xml b/externals/kyuubi-hive-sql-engine/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/externals/kyuubi-hive-sql-engine/src/test/resources/log4j2-test.xml +++ b/externals/kyuubi-hive-sql-engine/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/externals/kyuubi-jdbc-engine/src/test/resources/log4j2-test.xml b/externals/kyuubi-jdbc-engine/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/externals/kyuubi-jdbc-engine/src/test/resources/log4j2-test.xml +++ b/externals/kyuubi-jdbc-engine/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/externals/kyuubi-spark-sql-engine/src/test/resources/log4j2-test.xml b/externals/kyuubi-spark-sql-engine/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/externals/kyuubi-spark-sql-engine/src/test/resources/log4j2-test.xml +++ b/externals/kyuubi-spark-sql-engine/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/externals/kyuubi-trino-engine/src/test/resources/log4j2-test.xml b/externals/kyuubi-trino-engine/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/externals/kyuubi-trino-engine/src/test/resources/log4j2-test.xml +++ b/externals/kyuubi-trino-engine/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/integration-tests/kyuubi-flink-it/src/test/resources/log4j2-test.xml b/integration-tests/kyuubi-flink-it/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/integration-tests/kyuubi-flink-it/src/test/resources/log4j2-test.xml +++ b/integration-tests/kyuubi-flink-it/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/integration-tests/kyuubi-hive-it/src/test/resources/log4j2-test.xml b/integration-tests/kyuubi-hive-it/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/integration-tests/kyuubi-hive-it/src/test/resources/log4j2-test.xml +++ b/integration-tests/kyuubi-hive-it/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/integration-tests/kyuubi-jdbc-it/src/test/resources/log4j2-test.xml b/integration-tests/kyuubi-jdbc-it/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/integration-tests/kyuubi-jdbc-it/src/test/resources/log4j2-test.xml +++ b/integration-tests/kyuubi-jdbc-it/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/integration-tests/kyuubi-kubernetes-it/src/test/resources/log4j2-test.xml b/integration-tests/kyuubi-kubernetes-it/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/integration-tests/kyuubi-kubernetes-it/src/test/resources/log4j2-test.xml +++ b/integration-tests/kyuubi-kubernetes-it/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/integration-tests/kyuubi-trino-it/src/test/resources/log4j2-test.xml b/integration-tests/kyuubi-trino-it/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/integration-tests/kyuubi-trino-it/src/test/resources/log4j2-test.xml +++ b/integration-tests/kyuubi-trino-it/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/integration-tests/kyuubi-zookeeper-it/src/test/resources/log4j2-test.xml b/integration-tests/kyuubi-zookeeper-it/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/integration-tests/kyuubi-zookeeper-it/src/test/resources/log4j2-test.xml +++ b/integration-tests/kyuubi-zookeeper-it/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/kyuubi-common/src/main/resources/log4j2-defaults.xml b/kyuubi-common/src/main/resources/log4j2-defaults.xml index 63841959a..630584611 100644 --- a/kyuubi-common/src/main/resources/log4j2-defaults.xml +++ b/kyuubi-common/src/main/resources/log4j2-defaults.xml @@ -21,7 +21,7 @@ - + diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/Log4j2DivertAppender.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/Log4j2DivertAppender.scala index 0daaeae48..d8e37a019 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/Log4j2DivertAppender.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/Log4j2DivertAppender.scala @@ -93,7 +93,7 @@ object Log4j2DivertAppender { ap.getLayout.isInstanceOf[StringLayout]) .map(_.getLayout.asInstanceOf[StringLayout]) .getOrElse(PatternLayout.newBuilder().withPattern( - "%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n").build()) + "%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n%ex").build()) } def initialize(): Unit = { diff --git a/kyuubi-common/src/test/resources/log4j2-test.xml b/kyuubi-common/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/kyuubi-common/src/test/resources/log4j2-test.xml +++ b/kyuubi-common/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/kyuubi-ctl/src/test/resources/log4j2-test.xml b/kyuubi-ctl/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/kyuubi-ctl/src/test/resources/log4j2-test.xml +++ b/kyuubi-ctl/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/kyuubi-events/src/test/resources/log4j2-test.xml b/kyuubi-events/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/kyuubi-events/src/test/resources/log4j2-test.xml +++ b/kyuubi-events/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/kyuubi-ha/src/test/resources/log4j2-test.xml b/kyuubi-ha/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/kyuubi-ha/src/test/resources/log4j2-test.xml +++ b/kyuubi-ha/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/kyuubi-hive-jdbc/src/test/resources/log4j2-test.xml b/kyuubi-hive-jdbc/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/kyuubi-hive-jdbc/src/test/resources/log4j2-test.xml +++ b/kyuubi-hive-jdbc/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/kyuubi-metrics/src/test/resources/log4j2-test.xml b/kyuubi-metrics/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/kyuubi-metrics/src/test/resources/log4j2-test.xml +++ b/kyuubi-metrics/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - + diff --git a/kyuubi-rest-client/src/test/resources/log4j2-test.xml b/kyuubi-rest-client/src/test/resources/log4j2-test.xml index 13ea5322a..2f13b5777 100644 --- a/kyuubi-rest-client/src/test/resources/log4j2-test.xml +++ b/kyuubi-rest-client/src/test/resources/log4j2-test.xml @@ -21,13 +21,13 @@ - + - + diff --git a/kyuubi-server/src/test/resources/log4j2-test.xml b/kyuubi-server/src/test/resources/log4j2-test.xml index 25e37e859..bccbf1b0d 100644 --- a/kyuubi-server/src/test/resources/log4j2-test.xml +++ b/kyuubi-server/src/test/resources/log4j2-test.xml @@ -24,20 +24,20 @@ - + - + - + diff --git a/kyuubi-zookeeper/src/test/resources/log4j2-test.xml b/kyuubi-zookeeper/src/test/resources/log4j2-test.xml index bfc40dd6d..3110216c1 100644 --- a/kyuubi-zookeeper/src/test/resources/log4j2-test.xml +++ b/kyuubi-zookeeper/src/test/resources/log4j2-test.xml @@ -21,14 +21,14 @@ - + - +