org.apache.log.Logger.getChildLogger()方法的使用及代码示例

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

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

Logger.getChildLogger介绍

[英]Create a new child logger. The category of child logger is [current-category].subcategory
[中]创建一个新的子记录器。子记录器的类别为[当前类别]。子类别

代码示例

代码示例来源:origin: org.apache.avalon.framework/avalon-framework-impl

/**
   * Create a new child logger.
   * The name of the child logger is [current-loggers-name].[passed-in-name]
   * Throws <code>IllegalArgumentException</code> if name has an empty element name
   *
   * @param name the subname of this logger
   * @return the new logger
   */
  public final Logger getChildLogger( final String name )
  {
    return new LogKitLogger( m_logger.getChildLogger( name ) );
  }
}

代码示例来源:origin: org.apache.avalon.logkit/avalon-logkit

/**
 * Retrieve a logger for named category.
 *
 * @param category the context
 * @return the Logger
 */
public Logger getLoggerFor( final String category )
{
  return getRootLogger().getChildLogger( category );
}

代码示例来源:origin: org.apache.avalon.framework/avalon-framework-impl

/**
 * Helper method to setup other components with logger.
 * The logger has the subcategory of this components logger.
 *
 * @param component the component to pass logger object to
 * @param subCategory the subcategory to use (may be null)
 */
protected void setupLogger( final Object component, final String subCategory )
{
  org.apache.log.Logger logger = m_logger;
  if( null != subCategory )
  {
    logger = m_logger.getChildLogger( subCategory );
  }
  setupLogger( component, logger );
}

代码示例来源:origin: org.apache.avalon.logkit/avalon-logkit

return m_children[ i ].getChildLogger( remainder );
return child.getChildLogger( remainder );

代码示例来源:origin: org.apache.excalibur.containerkit/excalibur-logger

m_logkitLogger.getChildLogger( name );

相关文章