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

x33g5p2x  于2022-01-20 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(107)

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

Hierarchy.getRootLogger介绍

[英]Utility method to retrieve logger for hierarchy. This method is intended for use by sub-classes which can take responsibility for manipulating Logger directly.
[中]

代码示例

代码示例来源: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.excalibur.containerkit/excalibur-logger

/**
   * Return the default Logger.  This is basically the same
   * as getting the Logger for the "" category.
   */
  public Logger getDefaultLogger()
  {
    return new LogKitLogger( m_hierarchy.getRootLogger() );
  }
}

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

/**
 * Set the default log target for hierarchy.
 * This is the target inherited by loggers if no other target is specified.
 *
 * @param target the default target
 */
public void setDefaultLogTarget( final LogTarget target )
{
  if( null == target )
  {
    throw new IllegalArgumentException( "Can not set DefaultLogTarget to null" );
  }
  final LogTarget[] targets = new LogTarget[]{target};
  getRootLogger().setLogTargets( targets );
}

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

/**
 * Set the default priority for hierarchy.
 * This is the priority inherited by loggers if no other priority is specified.
 *
 * @param priority the default priority
 */
public void setDefaultPriority( final Priority priority )
{
  if( null == priority )
  {
    final String message = "Can not set default Hierarchy Priority to null";
    throw new IllegalArgumentException( message );
  }
  getRootLogger().setPriority( priority );
}

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

/**
 * Set the default log targets for this hierarchy.
 * These are the targets inherited by loggers if no other targets are specified
 *
 * @param targets the default targets
 */
public void setDefaultLogTargets( final LogTarget[] targets )
{
  if( null == targets || 0 == targets.length )
  {
    throw new IllegalArgumentException( "Can not set DefaultLogTargets to null" );
  }
  for( int i = 0; i < targets.length; i++ )
  {
    if( null == targets[ i ] )
    {
      final String message = "Can not set DefaultLogTarget element to null";
      throw new IllegalArgumentException( message );
    }
  }
  getRootLogger().setLogTargets( targets );
}

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

m_hierarchy.getRootLogger().unsetLogTargets( true );
final ErrorHandler errorHandler = new OurErrorHandler( getLogger() );
m_hierarchy.setErrorHandler( errorHandler );

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

logger = m_hierarchy.getRootLogger();
rootLoggerConfigured = true;

相关文章