From 21da58bfa47ed3d7a71cffb80d457c3fe39f6838 Mon Sep 17 00:00:00 2001 From: Shubhankar Ranade Date: Mon, 14 Apr 2025 09:09:26 -0400 Subject: [PATCH 1/3] Fix log4j2 config --- bin/kafka-rest-run-class | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/kafka-rest-run-class b/bin/kafka-rest-run-class index c993f52266..167cf9409a 100755 --- a/bin/kafka-rest-run-class +++ b/bin/kafka-rest-run-class @@ -31,11 +31,11 @@ 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/log4j2.yaml" ]; then # Dev environment - KAFKAREST_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/config/log4j2.yaml" + KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=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" + KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=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" + KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=file:/etc/kafka-rest/log4j2.yaml" fi fi From 1298a58b765dcd28766b5c237bd9c2fc4e841326 Mon Sep 17 00:00:00 2001 From: Shubhankar Ranade Date: Mon, 14 Apr 2025 09:56:42 -0400 Subject: [PATCH 2/3] Fix log4j2 config value --- bin/kafka-rest-run-class | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/kafka-rest-run-class b/bin/kafka-rest-run-class index 167cf9409a..ca26edbac2 100755 --- a/bin/kafka-rest-run-class +++ b/bin/kafka-rest-run-class @@ -31,11 +31,11 @@ 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/log4j2.yaml" ]; then # Dev environment - KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=file:$base_dir/config/log4j2.yaml" + KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=$base_dir/config/log4j2.yaml" elif [ -e "$base_dir/etc/kafka-rest/log4j2.yaml" ]; then # Simple zip file layout - KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=file:$base_dir/etc/kafka-rest/log4j2.yaml" + KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=$base_dir/etc/kafka-rest/log4j2.yaml" elif [ -e "/etc/kafka-rest/log4j2.yaml" ]; then # Normal install layout - KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=file:/etc/kafka-rest/log4j2.yaml" + KAFKAREST_LOG4J_OPTS="-Dlog4j2.configurationFile=/etc/kafka-rest/log4j2.yaml" fi fi From 397fe4bdd46e78c52a348481daf7a6128e28f772 Mon Sep 17 00:00:00 2001 From: Shubhankar Ranade Date: Mon, 14 Apr 2025 17:44:56 -0400 Subject: [PATCH 3/3] Fix log4j2.yaml --- config/log4j2.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/log4j2.yaml b/config/log4j2.yaml index 257ce20af2..69c8724f17 100644 --- a/config/log4j2.yaml +++ b/config/log4j2.yaml @@ -3,13 +3,13 @@ Configuration: Properties: Property: # Fallback if the system property is not set - - name: "kafka-rest.logs.dir" - value: "." + - name: "kafka-rest.log.dir" + value: "./logs" Appenders: RollingFile: name: "file" fileName: "${sys:kafka-rest.log.dir}/kafka-rest.log" - filePattern: "/kafka-rest.log.%i" + filePattern: "${sys:kafka-rest.log.dir}/kafka-rest.log.%i" PatternLayout: pattern: "[%d] %p %m (%c)%n" Policies: