logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1525497 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
Date Mon, 23 Sep 2013 03:37:37 GMT
Author: rpopma
Date: Mon Sep 23 03:37:36 2013
New Revision: 1525497

URL: http://svn.apache.org/r1525497
Log:
bugfix: unregistering a LoggerContext MBean should also unregister associated LoggerConfig
and Appender MBeans

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java?rev=1525497&r1=1525496&r2=1525497&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java
Mon Sep 23 03:37:36 2013
@@ -170,8 +170,6 @@ public final class Server {
      *
      * @param loggerContextName
      *            name of the logger context to unregister
-     * @throws JMException
-     *             if a problem occurs during de-registration
      */
     public static void unregisterContext(String loggerContextName) {
         final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
@@ -187,13 +185,13 @@ public final class Server {
      *            name of the logger context to unregister
      * @param mbs
      *            the MBean Server to unregister the instrumented objects from
-     * @throws JMException
-     *             if a problem occurs during de-registration
      */
     public static void unregisterContext(String contextName, MBeanServer mbs) {
         final String pattern = LoggerContextAdminMBean.PATTERN;
         final String search = String.format(pattern, contextName, "*");
         unregisterAllMatching(search, mbs);
+        unregisterLoggerConfigs(contextName, mbs);
+        unregisterAppenders(contextName, mbs);
     }
 
     private static void registerStatusLogger(final MBeanServer mbs, final Executor executor)



Mime
View raw message