[logback-dev] svn commit: r1314 - logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx

noreply.seb at qos.ch noreply.seb at qos.ch
Mon Feb 5 17:02:06 CET 2007


Author: seb
Date: Mon Feb  5 17:02:05 2007
New Revision: 1314

Modified:
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx/Configurator.java
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx/ConfiguratorMBean.java

Log:
JMXConfigurator now returns List<String> types instead of List<Logger> and List<Status> since it does not display information properly when connecting with jConsole.

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx/Configurator.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx/Configurator.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx/Configurator.java	Mon Feb  5 17:02:05 2007
@@ -126,16 +126,22 @@
     }
   }
 
-  public List<Logger> getLoggerList() {
+  public List<String> getLoggerList() {
     LoggerContext lc = (LoggerContext)context;
-    return lc.getLoggerList();
+    List<String> strList = new ArrayList<String>();
+    Iterator<Logger> it = lc.getLoggerList().iterator();
+    while(it.hasNext()) {
+      Logger log = it.next();
+      strList.add(log.getName());
+    }
+    return strList;
   }
   
-  public List<Status> getStatuses() {
-    List<Status> list = new ArrayList<Status>();
+  public List<String> getStatuses() {
+    List<String> list = new ArrayList<String>();
     Iterator<Status> it = context.getStatusManager().iterator();
     while(it.hasNext()) {
-      list.add(it.next());
+      list.add(it.next().toString());
     }
     return list;
   }

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx/ConfiguratorMBean.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx/ConfiguratorMBean.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/jmx/ConfiguratorMBean.java	Mon Feb  5 17:02:05 2007
@@ -12,9 +12,7 @@
 import java.net.URL;
 import java.util.List;
 
-import ch.qos.logback.classic.Logger;
 import ch.qos.logback.core.joran.spi.JoranException;
-import ch.qos.logback.core.status.Status;
 
 public interface ConfiguratorMBean {
   
@@ -30,7 +28,7 @@
   
   public String getLoggerEffectiveLevel(String loggerName);
 
-  public List<Logger> getLoggerList();
+  public List<String> getLoggerList();
   
-  public List<Status> getStatuses();
+  public List<String> getStatuses();
 }



More information about the logback-dev mailing list