365302: LogMBean added

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Thomas Becker 2012-01-11 14:39:37 +01:00 committed by Greg Wilkins
parent de418bc0e4
commit 08f4b79a66
1 changed files with 25 additions and 1 deletions

View File

@ -20,6 +20,8 @@ import java.net.URL;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties; import java.util.Properties;
import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.IO;
@ -59,6 +61,8 @@ public class Log
*/ */
public static boolean __ignored; public static boolean __ignored;
public static Map<String, Logger> __loggers = new HashMap<String, Logger>();
static static
{ {
/* Instantiate a default configuration properties (empty) /* Instantiate a default configuration properties (empty)
@ -418,6 +422,26 @@ public class Log
if (!initialized()) if (!initialized())
return null; 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;
} }
} }