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

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

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

Hierarchy.setDefaultLogTarget介绍

[英]Set the default log target for hierarchy. This is the target inherited by loggers if no other target is specified.
[中]设置层次结构的默认日志目标。如果未指定其他目标,则这是记录器继承的目标。

代码示例

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

public Logger2LogKitManager( final LoggerManager loggerManager )
{
  m_loggerManager = loggerManager;
  final LogKit2AvalonLoggerAdapter target =
    new LogKit2AvalonLoggerAdapter( loggerManager.getDefaultLogger() );
  m_hierarchy.setDefaultLogTarget( target );
}

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

/**
 * Create a hierarchy object.
 * The default LogTarget writes to stdout.
 */
public Hierarchy()
{
  m_errorHandler = new DefaultErrorHandler();
  m_rootLogger = new Logger( new InnerErrorHandler(),
                new InnerLoggerListener(),
                "", null, null );
  //Setup default output target to print to console
  final PatternFormatter formatter = new PatternFormatter( DEFAULT_FORMAT );
  final StreamTarget target = new StreamTarget( System.out, formatter );
  setDefaultLogTarget( target );
}

相关文章