frankvicky commented on code in PR #18185:
URL: https://github.com/apache/kafka/pull/18185#discussion_r1893614549
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java:
##########
@@ -203,7 +201,7 @@ private void setLevel(org.apache.logging.log4j.Logger
logger, Level level) {
LoggerConfig loggerConfig =
context.getConfiguration().getLoggerConfig(loggerName);
Level currentLevel = loggerConfig.getLevel();
- if (level.equals(currentLevel)) {
+ if (lastModifiedTimes.containsKey(loggerName) &&
level.equals(currentLevel)) {
Review Comment:
If we only check whether the level has changed, we'll run into the Log4j2
behavior change we mentioned before: all loggers will inherit the root logger's
level if they haven't been pre-configured with a level. This means they won't
appear in the `lastModified` map, and if they were already there, the update
time won't change.
I originally thought users would expect to see entries in `lastModified`
whenever `setLevel` is called, but this seems unnecessary. I'll fix this soon.
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java:
##########
@@ -203,7 +201,7 @@ private void setLevel(org.apache.logging.log4j.Logger
logger, Level level) {
LoggerConfig loggerConfig =
context.getConfiguration().getLoggerConfig(loggerName);
Level currentLevel = loggerConfig.getLevel();
- if (level.equals(currentLevel)) {
+ if (lastModifiedTimes.containsKey(loggerName) &&
level.equals(currentLevel)) {
Review Comment:
If we only check whether the level has changed, we'll run into the Log4j2
behavior change we mentioned before: all loggers will inherit the root logger's
level if they haven't been pre-configured with a level. This means they won't
appear in the `lastModified` map, and if they were already there, the update
time won't change.
I originally thought users would expect to see entries in `lastModified`
whenever `setLevel` is called, but this seems unnecessary. I'll fix this soon.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]