THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
The Kafka broker currently has a utility to adjust log levels via a JMX tool (jconsole, for example)MBeans. This is a scala utility, that we will rewrite in Java, move to kafka-clients package and use this utility to initialize JMX interface in the Kafka broker and Connect worker upon startup.
...
Code Block | ||
---|---|---|
| ||
public interface Log4jControllerMBean { /** * @return a list of all registered loggers */ List<String> getLoggers(); /** * Get the effective log level for a given logger * * @param logger name of the logger * @return its log level ("INFO", for example) */ String getLogLevel(String logger); /** * Set the log level for a logger * * @param logger name of the logger * @param level desired level ("INFO", for example) * @return true, if successfully set, false otherwise. */ Boolean setLogLevel(String logger, String level); } |
Applications will register this mBean with JMX the mBean server via a LogLevelManager
utility class:
Code Block | ||
---|---|---|
| ||
public class LogLevelManager { /** * Create and register a JMX mBean called Log4jController in the specified domain * * @param applicationNamedomain domain of the mBean */ public static void registerLog4jController(String namedomain) { // implementation } } |
...