mirror of https://github.com/apache/kafka.git
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 <chia7712@gmail.com>
This commit is contained in:
parent
08057eac53
commit
5fcbf3d3b1
|
@ -26,6 +26,20 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class representing an alter configuration entry containing name, value and operation type.
|
* 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 {
|
public class AlterConfigOp {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue