From 24ec2008b653bbcf375d820a45b187697b26cbd6 Mon Sep 17 00:00:00 2001 From: Marco van Zwetselaar Date: Fri, 1 Nov 2024 00:54:28 +0300 Subject: [PATCH 1/2] Disable DEBUG and TRACE logging by Kafka --- .../ansible/roles/kafka/files/log4j_2.X.X.properties | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/commcare_cloud/ansible/roles/kafka/files/log4j_2.X.X.properties b/src/commcare_cloud/ansible/roles/kafka/files/log4j_2.X.X.properties index c13f735b6c..ebfb521798 100644 --- a/src/commcare_cloud/ansible/roles/kafka/files/log4j_2.X.X.properties +++ b/src/commcare_cloud/ansible/roles/kafka/files/log4j_2.X.X.properties @@ -71,13 +71,18 @@ log4j.additivity.kafka.request.logger=false log4j.logger.kafka.network.RequestChannel$=WARN, requestAppender log4j.additivity.kafka.network.RequestChannel$=false -log4j.logger.kafka.controller=TRACE, controllerAppender +# Change the line below to adjust KRaft mode controller logging +log4j.logger.org.apache.kafka.controller=INFO, controllerAppender +log4j.additivity.org.apache.kafka.controller=false + +# Change the line below to adjust ZK mode controller logging +log4j.logger.kafka.controller=INFO, controllerAppender log4j.additivity.kafka.controller=false log4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender log4j.additivity.kafka.log.LogCleaner=false -log4j.logger.state.change.logger=TRACE, stateChangeAppender +log4j.logger.state.change.logger=INFO, stateChangeAppender log4j.additivity.state.change.logger=false # Access denials are logged at INFO level, change to DEBUG to also log allowed accesses From 7eb112295af7b049702e494fe541f795b0931696 Mon Sep 17 00:00:00 2001 From: Marco van Zwetselaar Date: Fri, 1 Nov 2024 01:02:49 +0300 Subject: [PATCH 2/2] Disable redundant stdout logging by Kafka - Otherwise this just duplicates the log files in the systemd journal --- .../ansible/roles/kafka/files/log4j_2.X.X.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commcare_cloud/ansible/roles/kafka/files/log4j_2.X.X.properties b/src/commcare_cloud/ansible/roles/kafka/files/log4j_2.X.X.properties index ebfb521798..bd15b09c08 100644 --- a/src/commcare_cloud/ansible/roles/kafka/files/log4j_2.X.X.properties +++ b/src/commcare_cloud/ansible/roles/kafka/files/log4j_2.X.X.properties @@ -1,4 +1,4 @@ -log4j.rootLogger=INFO, stdout, kafkaAppender +log4j.rootLogger=INFO, kafkaAppender log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout