From c2ad4c6387226152015bf948c5074deb68aa011a Mon Sep 17 00:00:00 2001 From: Shubhankar Ranade Date: Wed, 9 Apr 2025 16:52:39 -0400 Subject: [PATCH] Convert properties to yaml --- bin/kafka-rest-run-class | 12 ++++++------ kafka-rest/src/main/resources/log4j.properties | 5 ----- kafka-rest/src/main/resources/log4j2.yaml | 13 +++++++++++++ 3 files changed, 19 insertions(+), 11 deletions(-) delete mode 100644 kafka-rest/src/main/resources/log4j.properties create mode 100644 kafka-rest/src/main/resources/log4j2.yaml diff --git a/bin/kafka-rest-run-class b/bin/kafka-rest-run-class index d37310b763..c993f52266 100755 --- a/bin/kafka-rest-run-class +++ b/bin/kafka-rest-run-class @@ -30,12 +30,12 @@ done if [ "x$KAFKAREST_LOG4J_OPTS" = "x" ]; then # Test for files from dev -> packages so this will work as expected in dev if you have packages # installed - if [ -e "$base_dir/config/log4j.properties" ]; then # Dev environment - KAFKAREST_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/config/log4j.properties" - elif [ -e "$base_dir/etc/kafka-rest/log4j.properties" ]; then # Simple zip file layout - KAFKAREST_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/etc/kafka-rest/log4j.properties" - elif [ -e "/etc/kafka-rest/log4j.properties" ]; then # Normal install layout - KAFKAREST_LOG4J_OPTS="-Dlog4j.configuration=file:/etc/kafka-rest/log4j.properties" + if [ -e "$base_dir/config/log4j2.yaml" ]; then # Dev environment + KAFKAREST_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/config/log4j2.yaml" + elif [ -e "$base_dir/etc/kafka-rest/log4j2.yaml" ]; then # Simple zip file layout + KAFKAREST_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/etc/kafka-rest/log4j2.yaml" + elif [ -e "/etc/kafka-rest/log4j2.yaml" ]; then # Normal install layout + KAFKAREST_LOG4J_OPTS="-Dlog4j.configuration=file:/etc/kafka-rest/log4j2.yaml" fi fi diff --git a/kafka-rest/src/main/resources/log4j.properties b/kafka-rest/src/main/resources/log4j.properties deleted file mode 100644 index 43c18e3a2e..0000000000 --- a/kafka-rest/src/main/resources/log4j.properties +++ /dev/null @@ -1,5 +0,0 @@ -log4j.rootLogger=INFO, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c:%L)%n \ No newline at end of file diff --git a/kafka-rest/src/main/resources/log4j2.yaml b/kafka-rest/src/main/resources/log4j2.yaml new file mode 100644 index 0000000000..69d174c187 --- /dev/null +++ b/kafka-rest/src/main/resources/log4j2.yaml @@ -0,0 +1,13 @@ +Configuration: + name: "Log4j2" + Appenders: + Console: + name: "STDOUT" + target: "SYSTEM_OUT" + PatternLayout: + pattern: "[%d] %p %m (%c:%L)%n" + Loggers: + Root: + level: "INFO" + AppenderRef: + ref: "STDOUT"