Class LoggerFactory


  • public final class LoggerFactory
    extends java.lang.Object
    Factory to get logger instances. The system property net.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 Detail

      • instances

        private final java.util.concurrent.ConcurrentMap<java.lang.String,​Logger> instances
      • instanceConstructor

        private java.lang.reflect.Constructor<? extends Logger> instanceConstructor
    • Constructor Detail

      • LoggerFactory

        private LoggerFactory()
        Get an instance of LoggerFactory.
    • 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()