ethqunzhong commented on a change in pull request #14200:
URL: https://github.com/apache/pulsar/pull/14200#discussion_r807635627



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java
##########
@@ -437,5 +440,79 @@ private void doShutDownBrokerGracefully(int 
maxConcurrentUnloadPerSec,
         
pulsar().getBrokerService().unloadNamespaceBundlesGracefully(maxConcurrentUnloadPerSec,
 forcedTerminateTopic);
         pulsar().closeAsync();
     }
+
+    /**
+     * dynamically update log4j2 logger level at runtime.
+     *
+     * @param targetClassName : class name to update
+     * @param targetLevel     : target log level
+     */
+    private CompletableFuture<Void> internalUpdateLoggerLevelAsync(String 
targetClassName, String targetLevel) {
+        CompletableFuture<Void> loggerLevelFuture = new CompletableFuture<>();
+        CompletableFuture.runAsync(() -> {
+            try {
+                String className;
+                // if set "ROOT" will take effect to rootLogger
+                if (targetClassName.trim().equalsIgnoreCase("ROOT")) {
+                    className = LogManager.ROOT_LOGGER_NAME;
+                } else {
+                    try {
+                        className = targetClassName.trim();
+                        // Check if class name valid
+                        Class.forName(className);

Review comment:
       👍🏻 good suggestions. it is redundant. removed.




-- 
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]


Reply via email to