This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 5fcbf3d3b16 KAFKA-18853 Add documentation to remind users to use valid
LogLevelConfig constants (#20249)
5fcbf3d3b16 is described below
commit 5fcbf3d3b167857437812fc0301dd8c0c8966559
Author: jimmy <[email protected]>
AuthorDate: Wed Aug 27 10:52:02 2025 +0800
KAFKA-18853 Add documentation to remind users to use valid LogLevelConfig
constants (#20249)
This PR aims to add documentation to `alterLogLevelConfigs` method to
remind users to use valid LogLevelConfig constants.
Reviewers: Chia-Ping Tsai <[email protected]>
---
.../java/org/apache/kafka/clients/admin/AlterConfigOp.java | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git
a/clients/src/main/java/org/apache/kafka/clients/admin/AlterConfigOp.java
b/clients/src/main/java/org/apache/kafka/clients/admin/AlterConfigOp.java
index 48d5646764d..789c9f64a93 100644
--- a/clients/src/main/java/org/apache/kafka/clients/admin/AlterConfigOp.java
+++ b/clients/src/main/java/org/apache/kafka/clients/admin/AlterConfigOp.java
@@ -26,6 +26,20 @@ import java.util.stream.Collectors;
/**
* A class representing an alter configuration entry containing name, value
and operation type.
+ * <p>
+ * <b>Note for Broker Logger Configuration:</b><br>
+ * When altering broker logger levels (using {@link
org.apache.kafka.common.config.ConfigResource.Type#BROKER_LOGGER}),
+ * it is strongly recommended to use log level constants from {@link
org.apache.kafka.common.config.LogLevelConfig} instead of string literals.
+ * This ensures compatibility with Kafka's log level validation and avoids
potential configuration errors.
+ * <p>
+ * Example:
+ * <pre>
+ * Recommended approach:
+ * new AlterConfigOp(new ConfigEntry(loggerName,
LogLevelConfig.DEBUG_LOG_LEVEL), OpType.SET)
+ *
+ * Avoid this:
+ * new AlterConfigOp(new ConfigEntry(loggerName, "DEBUG"), OpType.SET)
+ * </pre>
*/
public class AlterConfigOp {