org.apache.log4j.LogManager.getLoggerRepository()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中org.apache.log4j.LogManager.getLoggerRepository()方法的一些代码示例,展示了LogManager.getLoggerRepository()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LogManager.getLoggerRepository()方法的具体详情如下:
包路径:org.apache.log4j.LogManager
类名称:LogManager
方法名:getLoggerRepository

LogManager.getLoggerRepository介绍

暂无

代码示例

代码示例来源:origin: log4j/log4j

/**
  Return the default Hierarchy instance.
  @deprecated Please use {@link LogManager#getLoggerRepository()} instead.
  @since 1.0
 */
public
static
LoggerRepository getDefaultHierarchy() {
 return LogManager.getLoggerRepository();
}

代码示例来源:origin: log4j/log4j

/**
  Retrieve the appropriate {@link Logger} instance.  
*/
public
static 
Logger getLogger(final String name) {
  // Delegate the actual manufacturing of the logger to the logger repository.
 return getLoggerRepository().getLogger(name);
}

代码示例来源:origin: log4j/log4j

public
static
Logger exists(final String name) {
 return getLoggerRepository().exists(name);
}

代码示例来源:origin: log4j/log4j

public
 static
 void resetConfiguration() {
  getLoggerRepository().resetConfiguration();
 }
}

代码示例来源:origin: log4j/log4j

/**
  Retrieve the appropriate root logger.
 */
public
static 
Logger getRootLogger() {
  // Delegate the actual manufacturing of the logger to the logger repository.
 return getLoggerRepository().getRootLogger();
}

代码示例来源:origin: log4j/log4j

/**
  Retrieve the appropriate {@link Logger} instance.  
*/
public
static 
Logger getLogger(final String name, final LoggerFactory factory) {
  // Delegate the actual manufacturing of the logger to the logger repository.
 return getLoggerRepository().getLogger(name, factory);
}

代码示例来源:origin: log4j/log4j

public
static
Enumeration getCurrentLoggers() {
 return getLoggerRepository().getCurrentLoggers();
}

代码示例来源:origin: log4j/log4j

public
static
void shutdown() {
 getLoggerRepository().shutdown();
}

代码示例来源:origin: log4j/log4j

/**
  Retrieve the appropriate {@link Logger} instance.  
*/
public
static 
Logger getLogger(final Class clazz) {
  // Delegate the actual manufacturing of the logger to the logger repository.
 return getLoggerRepository().getLogger(clazz.getName());
}

代码示例来源:origin: log4j/log4j

public HierarchyDynamicMBean() {
 hierarchy = LogManager.getLoggerRepository();
 buildDynamicMBeanInfo();
}

代码示例来源:origin: log4j/log4j

/**
Reads configuration options from an InputStream.

@since 1.2.17
*/
public
static
void configure(InputStream inputStream) {
new PropertyConfigurator().doConfigure(inputStream,
         LogManager.getLoggerRepository());
}

代码示例来源:origin: log4j/log4j

/**
   Call {@link PropertyConfigurator#configure(String)} with the
   <code>filename</code> to reconfigure log4j. */
 public
 void doOnChange() {
  new PropertyConfigurator().doConfigure(filename,
            LogManager.getLoggerRepository());
 }
}

代码示例来源:origin: log4j/log4j

/**
 */
static
public
void configure(String configFilename) {
 new PropertyConfigurator().doConfigure(configFilename,
           LogManager.getLoggerRepository());
}

代码示例来源:origin: log4j/log4j

/**
 Read configuration options from url <code>configURL</code>.

 @since 0.8.2
*/
public
static
void configure(java.net.URL configURL) {
 new PropertyConfigurator().doConfigure(configURL,
          LogManager.getLoggerRepository());
}

代码示例来源:origin: log4j/log4j

/**
  A static version of {@link #doConfigure(URL, LoggerRepository)}.
 */
static
public
void configure(URL url) throws FactoryConfigurationError {
 new DOMConfigurator().doConfigure(url, LogManager.getLoggerRepository());
}

代码示例来源:origin: log4j/log4j

/**
  Configure log4j using a <code>configuration</code> element as
  defined in the log4j.dtd. 
*/
static
public
void configure (Element element) {
 DOMConfigurator configurator = new DOMConfigurator();
 configurator.doConfigure(element,  LogManager.getLoggerRepository());
}

代码示例来源:origin: log4j/log4j

/**
  A static version of {@link #doConfigure(String, LoggerRepository)}.  */
static
public
void configure(String filename) throws FactoryConfigurationError {
 new DOMConfigurator().doConfigure(filename, 
          LogManager.getLoggerRepository());
}

代码示例来源:origin: log4j/log4j

/**
   Call {@link DOMConfigurator#configure(String)} with the
   <code>filename</code> to reconfigure log4j. */
 public
 void doOnChange() {
  new DOMConfigurator().doConfigure(filename, 
           LogManager.getLoggerRepository());
 }
}

代码示例来源:origin: log4j/log4j

/**
  Read configuration options from <code>properties</code>.
  See {@link #doConfigure(String, LoggerRepository)} for the expected format.
*/
static
public
void configure(Properties properties) {
 new PropertyConfigurator().doConfigure(properties,
           LogManager.getLoggerRepository());
}

代码示例来源:origin: log4j/log4j

LoggerRepository  genericHierarchy() {
  if(genericHierarchy == null) {
   File f = new File(dir, GENERIC+CONFIG_FILE_EXT);
   if(f.exists()) {
  genericHierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
  new PropertyConfigurator().doConfigure(f.getAbsolutePath(), genericHierarchy);
   } else {
  cat.warn("Could not find config file ["+f+
     "]. Will use the default hierarchy.");
  genericHierarchy = LogManager.getLoggerRepository();
   }
  }
  return genericHierarchy;
 }
}

相关文章