org.apache.logging.log4j.core.config.Configuration.createConfiguration()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(162)

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

Configuration.createConfiguration介绍

暂无

代码示例

代码示例来源:origin: apache/hive

for (final Node cnode : node.getChildren()) {
 final Node appNode = new Node(cnode);
 config.createConfiguration(appNode, event);
 if (appNode.getObject() instanceof Appender) {
  final Appender app = appNode.getObject();

代码示例来源:origin: org.apache.hive/hive-llap-server

for (final Node cnode : node.getChildren()) {
 final Node appNode = new Node(cnode);
 config.createConfiguration(appNode, event);
 if (appNode.getObject() instanceof Appender) {
  final Appender app = appNode.getObject();

代码示例来源:origin: ops4j/org.ops4j.pax.logging

public Appender createAppender(final String appenderName, final String actualName) {
    final Node node = nodeMap.get(appenderName);
    if (node == null) {
      LOGGER.error("No node named {} in {}", appenderName, this);
      return null;
    }
    node.getAttributes().put("name", actualName);
    if (node.getType().getElementName().equals(Appender.ELEMENT_TYPE)) {
      final Node appNode = new Node(node);
      configuration.createConfiguration(appNode, null);
      if (appNode.getObject() instanceof Appender) {
        final Appender app = appNode.getObject();
        app.start();
        return app;
      }
      LOGGER.error("Unable to create Appender of type " + node.getName());
      return null;
    }
    LOGGER.error("No Appender was configured for name {} " + appenderName);
    return null;
  }
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

private Appender createAppender(final Route route, final LogEvent event) {
  final Node routeNode = route.getNode();
  for (final Node node : routeNode.getChildren()) {
    if (node.getType().getElementName().equals(Appender.ELEMENT_TYPE)) {
      final Node appNode = new Node(node);
      configuration.createConfiguration(appNode, event);
      if (appNode.getObject() instanceof Appender) {
        final Appender app = appNode.getObject();
        app.start();
        return app;
      }
      error("Unable to create Appender of type " + node.getName());
      return null;
    }
  }
  error("No Appender was configured for route " + route.getKey());
  return null;
}

相关文章