Java 类org.apache.logging.log4j.core.config.builder.api.RootLoggerComponentBuilder 实例源码

项目:coteafs-logger    文件:ConfigBuilder.java   
private void addRootLogger (final ConfigurationBuilder <BuiltConfiguration> build) {
    final RootLoggerComponentBuilder root = build.newRootLogger (this.loggers   .getLevel ()
                                                                                .getStatus ());
    for (final AppenderRefSetting setting : this.loggers.getAppenderRef ()) {
        final AppenderRefComponentBuilder ref = build.newAppenderRef (setting.getRef ());
        addAttributes (ref, setting.getAttributes ());
        root.add (ref);
    }
    build.add (root);
}
项目:ldbc_graphalytics    文件:LogUtil.java   
public static void intializeLoggers() {
    ConfigurationBuilder<BuiltConfiguration> builder = ConfigurationBuilderFactory.newConfigurationBuilder();
    builder.setConfigurationName("logger");
    RootLoggerComponentBuilder rootLogger = builder.newRootLogger(Level.DEBUG);
    builder.add(rootLogger);

    Configurator.initialize(builder.build());
}
项目:logging-log4j2    文件:Log4j1ConfigurationParser.java   
private void buildRootLogger(final String rootLoggerValue) {
    if (rootLoggerValue == null) {
        return;
    }
    final String[] rootLoggerParts = rootLoggerValue.split(COMMA_DELIMITED_RE);
    final String rootLoggerLevel = getLevelString(rootLoggerParts, Level.ERROR.name());
    final RootLoggerComponentBuilder loggerBuilder = builder.newRootLogger(rootLoggerLevel);
    //
    final String[] sortedAppenderNames = Arrays.copyOfRange(rootLoggerParts, 1, rootLoggerParts.length);
    Arrays.sort(sortedAppenderNames);
    for (final String appender : sortedAppenderNames) {
        loggerBuilder.add(builder.newAppenderRef(appender));
    }
    builder.add(loggerBuilder);
}
项目:logging-log4j2    文件:PropertiesConfigurationBuilder.java   
private RootLoggerComponentBuilder createRootLogger(final Properties properties) {
    final String level = Strings.trimToNull((String) properties.remove("level"));
    final String type = (String) properties.remove(CONFIG_TYPE);
    final String location = (String) properties.remove("includeLocation");
    final boolean includeLocation;
    final RootLoggerComponentBuilder loggerBuilder;
    if (type != null) {
        if (type.equalsIgnoreCase("asyncRoot")) {
            if (location != null) {
                includeLocation = Boolean.parseBoolean(location);
                loggerBuilder = builder.newAsyncRootLogger(level, includeLocation);
            } else {
                loggerBuilder = builder.newAsyncRootLogger(level);
            }
        } else {
            throw new ConfigurationException("Unknown Logger type for root logger" + type);
        }
    } else {
        if (location != null) {
            includeLocation = Boolean.parseBoolean(location);
            loggerBuilder = builder.newRootLogger(level, includeLocation);
        } else {
            loggerBuilder = builder.newRootLogger(level);
        }
    }
    addLoggersToComponent(loggerBuilder, properties);
    return addFiltersToComponent(loggerBuilder, properties);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public ConfigurationBuilder<T> add(final RootLoggerComponentBuilder builder) {
    for (final Component c : loggers.getComponents()) {
        if (c.getPluginType().equals(LoggerConfig.ROOT)) {
            throw new ConfigurationException("Root Logger was previously defined");
        }
    }
    return add(loggers, builder);
}
项目:logging-log4j2    文件:DefaultRootLoggerComponentBuilder.java   
@Override
public RootLoggerComponentBuilder add(final AppenderRefComponentBuilder builder) {
    return addComponent(builder);
}
项目:logging-log4j2    文件:DefaultRootLoggerComponentBuilder.java   
@Override
public RootLoggerComponentBuilder add(final FilterComponentBuilder builder) {
    return addComponent(builder);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newAsyncRootLogger() {
    return new DefaultRootLoggerComponentBuilder(this, "AsyncRoot");
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newAsyncRootLogger(boolean includeLocation) {
    return new DefaultRootLoggerComponentBuilder(this, null, "AsyncRoot", includeLocation);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newAsyncRootLogger(final Level level) {
    return new DefaultRootLoggerComponentBuilder(this, level.toString(), "AsyncRoot");
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newAsyncRootLogger(final Level level, final boolean includeLocation) {
    return new DefaultRootLoggerComponentBuilder(this, level.toString(), "AsyncRoot", includeLocation);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newAsyncRootLogger(final String level) {
    return new DefaultRootLoggerComponentBuilder(this, level, "AsyncRoot");
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newAsyncRootLogger(final String level, final boolean includeLocation) {
    return new DefaultRootLoggerComponentBuilder(this, level, "AsyncRoot", includeLocation);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newRootLogger() {
    return new DefaultRootLoggerComponentBuilder(this, null);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newRootLogger(boolean includeLocation) {
    return new DefaultRootLoggerComponentBuilder(this, null, includeLocation);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newRootLogger(final Level level) {
    return new DefaultRootLoggerComponentBuilder(this, level.toString());
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newRootLogger(final Level level, final boolean includeLocation) {
    return new DefaultRootLoggerComponentBuilder(this, level.toString(), includeLocation);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newRootLogger(final String level) {
    return new DefaultRootLoggerComponentBuilder(this, level);
}
项目:logging-log4j2    文件:DefaultConfigurationBuilder.java   
@Override
public RootLoggerComponentBuilder newRootLogger(final String level, final boolean includeLocation) {
    return new DefaultRootLoggerComponentBuilder(this, level, includeLocation);
}