dongjinleekr commented on code in PR #17373:
URL: https://github.com/apache/kafka/pull/17373#discussion_r1845315012
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Loggers.java:
##########
@@ -45,9 +50,9 @@ public class Loggers {
private static final Logger log = LoggerFactory.getLogger(Loggers.class);
/**
- * Log4j uses "root" (case-insensitive) as name of the root logger.
+ * Log4j2 uses "" (empty string) as name of the root logger.
*/
- private static final String ROOT_LOGGER_NAME = "root";
+ private static final String ROOT_LOGGER_NAME = "";
Review Comment:
@mimaison @frankvicky @gharris1727
**We should retain the root logger's name as `root`, against log4j2's naming
change.** Here is the comment from [the original
implementation](https://github.com/apache/kafka/pull/7898/commits/fd34fbc8c454ddf1558a05acc932e44601ef9f87#diff-eafb580880c7f5ea6aa6a710cecf3acd4c0ede5ec5ac0998c60cd9e92abc5176L51):
> Note: In log4j, the root logger's name was "root" and Kafka also followed
that name for dynamic logging control feature.
>
> The root logger's name is changed in log4j2 to empty string (see:
[[LogManager.ROOT_LOGGER_NAME]]) but for backward-compatibility. Kafka keeps
its original root logger name. It is why here is a dedicated definition for the
root logger name.
To maintain compatibility with Kafka Connect's REST API, we need to use
`root` to indicate the root logger.
Since the log4j2 logger names are generally `{package}.{class}` form,
defining a `root` named logger is almost not reasonable. So, we don't need to
be concerned about it.
@showuon Long time no see :smiley: Since it is not mentioned in the [KIP
documentation](https://cwiki.apache.org/confluence/display/KAFKA/KIP-653%3A+Upgrade+log4j+to+log4j2),
so I will add a subsection explaining this design decision. I got some
vacation this week! 😇
--
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]