Save This Page
Home » apache-log4j-1.2.15 » org.apache » log4j » [javadoc | source]
org.apache.log4j
public class: LogManager [javadoc | source]
java.lang.Object
   org.apache.log4j.LogManager
Use the LogManager class to retreive Logger instances or to operate on the current LoggerRepository . When the LogManager class is loaded into memory the default initalzation procedure is inititated. The default intialization procedure is described in the short log4j manual.
Field Summary
public static final  String DEFAULT_CONFIGURATION_FILE   
     
    static final  String DEFAULT_XML_CONFIGURATION_FILE     
    public static final  String DEFAULT_CONFIGURATION_KEY   
       
      public static final  String CONFIGURATOR_CLASS_KEY   
         
        public static final  String DEFAULT_INIT_OVERRIDE_KEY   
           
          Method from org.apache.log4j.LogManager Summary:
          exists,   getCurrentLoggers,   getLogger,   getLogger,   getLogger,   getLoggerRepository,   getRootLogger,   resetConfiguration,   setRepositorySelector,   shutdown
          Methods from java.lang.Object:
          equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
          Method from org.apache.log4j.LogManager Detail:
           public static Logger exists(String name) 
           public static Enumeration getCurrentLoggers() 
           public static Logger getLogger(String name) 
            Retrieve the appropriate Logger instance.
           public static Logger getLogger(Class clazz) 
            Retrieve the appropriate Logger instance.
           public static Logger getLogger(String name,
              LoggerFactory factory) 
            Retrieve the appropriate Logger instance.
           public static LoggerRepository getLoggerRepository() 
           public static Logger getRootLogger() 
            Retrieve the appropriate root logger.
           public static  void resetConfiguration() 
           public static  void setRepositorySelector(RepositorySelector selector,
              Object guard) throws IllegalArgumentException 
            Sets LoggerFactory but only if the correct guard is passed as parameter.

            Initally the guard is null. If the guard is null, then invoking this method sets the logger factory and the guard. Following invocations will throw a IllegalArgumentException , unless the previously set guard is passed as the second parameter.

            This allows a high-level component to set the RepositorySelector used by the LogManager.

            For example, when tomcat starts it will be able to install its own repository selector. However, if and when Tomcat is embedded within JBoss, then JBoss will install its own repository selector and Tomcat will use the repository selector set by its container, JBoss.

           public static  void shutdown()