Class LogManager


  • public final class LogManager
    extends java.lang.Object
    The main entry point to Log4j 1.
    • Field Detail

      • DEFAULT_CONFIGURATION_FILE

        @Deprecated
        public static final java.lang.String DEFAULT_CONFIGURATION_FILE
        Deprecated.
        This variable is for internal use only. It will become package protected in future versions.
        See Also:
        Constant Field Values
      • DEFAULT_CONFIGURATION_KEY

        @Deprecated
        public static final java.lang.String DEFAULT_CONFIGURATION_KEY
        Deprecated.
        This variable is for internal use only. It will become private in future versions.
        See Also:
        Constant Field Values
      • CONFIGURATOR_CLASS_KEY

        @Deprecated
        public static final java.lang.String CONFIGURATOR_CLASS_KEY
        Deprecated.
        This variable is for internal use only. It will become private in future versions.
        See Also:
        Constant Field Values
      • DEFAULT_INIT_OVERRIDE_KEY

        @Deprecated
        public static final java.lang.String DEFAULT_INIT_OVERRIDE_KEY
        Deprecated.
        This variable is for internal use only. It will become private in future versions.
        See Also:
        Constant Field Values
      • DEFAULT_XML_CONFIGURATION_FILE

        static final java.lang.String DEFAULT_XML_CONFIGURATION_FILE
        See Also:
        Constant Field Values
      • LOG4J_CORE_PRESENT

        private static final boolean LOG4J_CORE_PRESENT
    • Constructor Detail

      • LogManager

        public LogManager()
    • Method Detail

      • checkLog4jCore

        private static boolean checkLog4jCore()
      • exists

        public static Logger exists​(java.lang.String name)
        Tests if a logger for the given name exists.
        Parameters:
        name - logger name to test.
        Returns:
        whether a logger for the given name exists.
      • exists

        static Logger exists​(java.lang.String name,
                             java.lang.ClassLoader classLoader)
      • getContext

        static LoggerContext getContext​(java.lang.ClassLoader classLoader)
        Gets a LoggerContext.
        Parameters:
        loader - The ClassLoader for the context. If null the context will attempt to determine the appropriate ClassLoader.
        Returns:
        a LoggerContext.
      • getCurrentLoggers

        public static java.util.Enumeration getCurrentLoggers()
        Gets an enumeration of the current loggers.
        Returns:
        an enumeration of the current loggers.
      • getCurrentLoggers

        static java.util.Enumeration getCurrentLoggers​(java.lang.ClassLoader classLoader)
      • getHierarchy

        static Hierarchy getHierarchy()
      • getLogger

        public static Logger getLogger​(java.lang.Class<?> clazz)
        Gets the logger for the given class.
      • getLogger

        public static Logger getLogger​(java.lang.String name)
        Gets the logger for the given name.
      • getLogger

        static Logger getLogger​(java.lang.String name,
                                java.lang.ClassLoader classLoader)
      • getLogger

        public static Logger getLogger​(java.lang.String name,
                                       LoggerFactory factory)
      • getLogger

        static Logger getLogger​(java.lang.String name,
                                LoggerFactory factory,
                                java.lang.ClassLoader classLoader)
      • getRootLogger

        public static Logger getRootLogger()
        Gets the root logger.
      • getRootLogger

        static Logger getRootLogger​(java.lang.ClassLoader classLoader)
      • isLog4jCorePresent

        static boolean isLog4jCorePresent()
      • reconfigure

        static void reconfigure​(java.lang.ClassLoader classLoader)
      • resetConfiguration

        public static void resetConfiguration()
      • resetConfiguration

        static void resetConfiguration​(java.lang.ClassLoader classLoader)
      • setRepositorySelector

        public static void setRepositorySelector​(RepositorySelector selector,
                                                 java.lang.Object guard)
                                          throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • shutdown

        public static void shutdown()
        Shuts down the current configuration.
      • shutdown

        static void shutdown​(java.lang.ClassLoader classLoader)