From e0d8c9f238d049a61808570171a7a764f11c3afc Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Tue, 12 Mar 2024 13:25:28 +0200 Subject: [PATCH 1/4] [improve][test] Reduce logging overhead in tests - don't log the location where the log was added since this causes a high overhead --- buildtools/src/main/resources/log4j2.xml | 2 +- pulsar-broker/src/test/resources/log4j2.xml | 2 +- tiered-storage/jcloud/src/test/resources/log4j2-test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildtools/src/main/resources/log4j2.xml b/buildtools/src/main/resources/log4j2.xml index 184f58487eaf0..b0d01a734c518 100644 --- a/buildtools/src/main/resources/log4j2.xml +++ b/buildtools/src/main/resources/log4j2.xml @@ -22,7 +22,7 @@ - + diff --git a/pulsar-broker/src/test/resources/log4j2.xml b/pulsar-broker/src/test/resources/log4j2.xml index 4038dd59b1d79..e1f31e6de23ac 100644 --- a/pulsar-broker/src/test/resources/log4j2.xml +++ b/pulsar-broker/src/test/resources/log4j2.xml @@ -24,7 +24,7 @@ xsi:schemaLocation="http://logging.apache.org/log4j/2.0/config https://logging.apache.org/log4j/2.0/log4j-core.xsd"> - + diff --git a/tiered-storage/jcloud/src/test/resources/log4j2-test.yml b/tiered-storage/jcloud/src/test/resources/log4j2-test.yml index cab9dd0dd5625..c8f5c7b49566b 100644 --- a/tiered-storage/jcloud/src/test/resources/log4j2-test.yml +++ b/tiered-storage/jcloud/src/test/resources/log4j2-test.yml @@ -33,7 +33,7 @@ Configuration: name: STDOUT target: SYSTEM_OUT PatternLayout: - Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t:%C@%L] %-5level %logger{36} - %msg%n" + Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t:%C] %-5level %logger{36} - %msg%n" File: name: File fileName: ${filename} From b63875d2565f63e69dd2bc9d6713800acf69059a Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Tue, 12 Mar 2024 14:58:41 +0200 Subject: [PATCH 2/4] Remove the caller class too - see https://logging.apache.org/log4j/2.x/manual/layouts.html#location-information --- pulsar-broker/src/test/resources/log4j2.xml | 2 +- tiered-storage/jcloud/src/test/resources/log4j2-test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pulsar-broker/src/test/resources/log4j2.xml b/pulsar-broker/src/test/resources/log4j2.xml index e1f31e6de23ac..94443543b7c13 100644 --- a/pulsar-broker/src/test/resources/log4j2.xml +++ b/pulsar-broker/src/test/resources/log4j2.xml @@ -24,7 +24,7 @@ xsi:schemaLocation="http://logging.apache.org/log4j/2.0/config https://logging.apache.org/log4j/2.0/log4j-core.xsd"> - + diff --git a/tiered-storage/jcloud/src/test/resources/log4j2-test.yml b/tiered-storage/jcloud/src/test/resources/log4j2-test.yml index c8f5c7b49566b..087a0b494f897 100644 --- a/tiered-storage/jcloud/src/test/resources/log4j2-test.yml +++ b/tiered-storage/jcloud/src/test/resources/log4j2-test.yml @@ -33,12 +33,12 @@ Configuration: name: STDOUT target: SYSTEM_OUT PatternLayout: - Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t:%C] %-5level %logger{36} - %msg%n" + Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t] %-5level %logger{36} - %msg%n" File: name: File fileName: ${filename} PatternLayout: - Pattern: "%d %p %C{1.} [%t] %m%n" + Pattern: "%d %p [%t] %m%n" Filters: ThresholdFilter: level: error From 4b2055c862795f8fd15cc6aee49224daabdb887f Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Tue, 12 Mar 2024 15:06:30 +0200 Subject: [PATCH 3/4] Revert "Remove the caller class too" This reverts commit b63875d2565f63e69dd2bc9d6713800acf69059a. --- pulsar-broker/src/test/resources/log4j2.xml | 2 +- tiered-storage/jcloud/src/test/resources/log4j2-test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pulsar-broker/src/test/resources/log4j2.xml b/pulsar-broker/src/test/resources/log4j2.xml index 94443543b7c13..e1f31e6de23ac 100644 --- a/pulsar-broker/src/test/resources/log4j2.xml +++ b/pulsar-broker/src/test/resources/log4j2.xml @@ -24,7 +24,7 @@ xsi:schemaLocation="http://logging.apache.org/log4j/2.0/config https://logging.apache.org/log4j/2.0/log4j-core.xsd"> - + diff --git a/tiered-storage/jcloud/src/test/resources/log4j2-test.yml b/tiered-storage/jcloud/src/test/resources/log4j2-test.yml index 087a0b494f897..c8f5c7b49566b 100644 --- a/tiered-storage/jcloud/src/test/resources/log4j2-test.yml +++ b/tiered-storage/jcloud/src/test/resources/log4j2-test.yml @@ -33,12 +33,12 @@ Configuration: name: STDOUT target: SYSTEM_OUT PatternLayout: - Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t] %-5level %logger{36} - %msg%n" + Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t:%C] %-5level %logger{36} - %msg%n" File: name: File fileName: ${filename} PatternLayout: - Pattern: "%d %p [%t] %m%n" + Pattern: "%d %p %C{1.} [%t] %m%n" Filters: ThresholdFilter: level: error From 0ecf801ea9e204c53b10c35e0b96b51080a6512c Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Tue, 12 Mar 2024 15:08:37 +0200 Subject: [PATCH 4/4] Replace %C with %c where applicable --- pulsar-broker/src/test/resources/log4j2.xml | 2 +- tiered-storage/jcloud/src/test/resources/log4j2-test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pulsar-broker/src/test/resources/log4j2.xml b/pulsar-broker/src/test/resources/log4j2.xml index e1f31e6de23ac..38a57df80d57b 100644 --- a/pulsar-broker/src/test/resources/log4j2.xml +++ b/pulsar-broker/src/test/resources/log4j2.xml @@ -24,7 +24,7 @@ xsi:schemaLocation="http://logging.apache.org/log4j/2.0/config https://logging.apache.org/log4j/2.0/log4j-core.xsd"> - + diff --git a/tiered-storage/jcloud/src/test/resources/log4j2-test.yml b/tiered-storage/jcloud/src/test/resources/log4j2-test.yml index c8f5c7b49566b..f5ee5c9a53dd7 100644 --- a/tiered-storage/jcloud/src/test/resources/log4j2-test.yml +++ b/tiered-storage/jcloud/src/test/resources/log4j2-test.yml @@ -33,12 +33,12 @@ Configuration: name: STDOUT target: SYSTEM_OUT PatternLayout: - Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t:%C] %-5level %logger{36} - %msg%n" + Pattern: "%d{ISO8601_OFFSET_DATE_TIME_HHMM} [%t] %-5level %logger{36} - %msg%n" File: name: File fileName: ${filename} PatternLayout: - Pattern: "%d %p %C{1.} [%t] %m%n" + Pattern: "%d %p %c{1.} [%t] %m%n" Filters: ThresholdFilter: level: error