Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 c1f42baa85..f6ce23a42e 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;
}
}

Back to the top