aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2012-01-11 08:39:37 (EST)
committerGreg Wilkins2012-01-11 20:36:16 (EST)
commit08f4b79a666c2d28793f3b6ed96a4d082a462cdf (patch)
treed183f2c8b75e5520d30d7da03dfb2d1e08ce8895
parentde418bc0e4140519ba8e425ca17174409cdd4691 (diff)
downloadorg.eclipse.jetty.project-08f4b79a666c2d28793f3b6ed96a4d082a462cdf.zip
org.eclipse.jetty.project-08f4b79a666c2d28793f3b6ed96a4d082a462cdf.tar.gz
org.eclipse.jetty.project-08f4b79a666c2d28793f3b6ed96a4d082a462cdf.tar.bz2
365302: LogMBean added
Signed-off-by: Greg Wilkins <gregw@webtide.com>
-rw-r--r--jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java
index c1f42ba..f6ce23a 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java
@@ -20,6 +20,8 @@ import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Properties;
import org.eclipse.jetty.util.IO;
@@ -59,6 +61,8 @@ public class Log
*/
public static boolean __ignored;
+ public static Map<String, Logger> __loggers = new HashMap<String, Logger>();
+
static
{
/* Instantiate a default configuration properties (empty)
@@ -418,6 +422,26 @@ public class Log
if (!initialized())
return null;
- return name == null ? LOG : LOG.getLogger(name);
+ if(name==null)
+ return LOG;
+
+ Logger logger = __loggers.get(name);
+ if(logger==null)
+ {
+ logger = LOG.getLogger(name);
+ __loggers.put(name,logger);
+ }
+
+ return logger;
+ }
+
+ /**
+ * Get a map of all configured {@link Logger} instances.
+ *
+ * @return a map of all configured {@link Logger} instances
+ */
+ public static Map<String, Logger> getLoggers()
+ {
+ return __loggers;
}
}