Package net.spy.memcached.compat.log
Class LoggerFactory
- java.lang.Object
-
- net.spy.memcached.compat.log.LoggerFactory
-
public final class LoggerFactory extends java.lang.Object
Factory to get logger instances. The system propertynet.spy.log.LoggerImpl
should point to an implementation of net.spy.compat.log.Logger to use.Depending on how and where this was compiled, a sun logger (jdk 1.4) and/or log4j logger implementation may be included. Both are included with the official distribution.
- See Also:
AbstractLogger
-
-
Field Summary
Fields Modifier and Type Field Description private static LoggerFactory
instance
private java.lang.reflect.Constructor<? extends Logger>
instanceConstructor
private java.util.concurrent.ConcurrentMap<java.lang.String,Logger>
instances
-
Constructor Summary
Constructors Modifier Constructor Description private
LoggerFactory()
Get an instance of LoggerFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
getConstructor()
static Logger
getLogger(java.lang.Class<?> clazz)
Get a logger by class.static Logger
getLogger(java.lang.String name)
Get a logger by name.private Logger
getNewInstance(java.lang.String name)
private static void
init()
private Logger
internalGetLogger(java.lang.String name)
-
-
-
Field Detail
-
instance
private static volatile LoggerFactory instance
-
instances
private final java.util.concurrent.ConcurrentMap<java.lang.String,Logger> instances
-
instanceConstructor
private java.lang.reflect.Constructor<? extends Logger> instanceConstructor
-
-
Method Detail
-
init
private static void init()
-
getLogger
public static Logger getLogger(java.lang.Class<?> clazz)
Get a logger by class.- Parameters:
clazz
- the class for which we want the logger.- Returns:
- a Logger instance
-
getLogger
public static Logger getLogger(java.lang.String name)
Get a logger by name.- Parameters:
name
- the name for which we want the logger- Returns:
- a Logger instance
-
internalGetLogger
private Logger internalGetLogger(java.lang.String name)
-
getNewInstance
private Logger getNewInstance(java.lang.String name) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
-
getConstructor
private void getConstructor()
-
-