JimmyWang6 commented on code in PR #20249:
URL: https://github.com/apache/kafka/pull/20249#discussion_r2297548754


##########
core/src/main/java/kafka/server/logger/RuntimeLoggerManager.java:
##########
@@ -69,6 +69,21 @@ public void applyChangesForResource(
         }
     }
 
+    /**
+     * Alters the log level configurations for specified loggers.
+     * <p>
+     * This method allows modifying log levels for individual loggers via 
{@link AlterableConfig}
+     * operations (SET or DELETE). Valid log levels are restricted to 
constants defined in {@link LogLevelConfig}.
+     * <p>
+     *
+     * @param ops A collection of {@link AlterableConfig} objects, where each 
object specifies:
+     * <ul>           
+     *   <li> name: The logger name to configure.
+     *   <li> value: The log level (must be a valid {@link LogLevelConfig} 
constant).
+     *   <li> configOperation: The operation type (SET or DELETE).
+     * </ul>
+     * @throws InvalidConfigurationException if the log level is not valid.
+     */
     void alterLogLevelConfigs(Collection<AlterableConfig> ops) {

Review Comment:
   @chia7712, thank you so much for your review!
   
   I have a slight confusion regarding this issue. As for `AlterConfigOp`, it 
defines four OpType values: `SET, DELETE, APPEND, and SUBTTRACT`. This class is 
not exclusively used for modifying log level configurations—it also applies to 
altering other settings (such as group and topic configurations, among others).
   
   I understand your perspective that we should only allow users to set valid 
log levels. However, I wonder if it would be more appropriate to handle the 
logging logic within the `RuntimeLogManager` instead of embedding it in 
AlterConfigOp. What's your opinions?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to