当前位置: 首页>>代码示例>>Java>>正文


Java StrLookup类代码示例

本文整理汇总了Java中org.apache.logging.log4j.core.lookup.StrLookup的典型用法代码示例。如果您正苦于以下问题:Java StrLookup类的具体用法?Java StrLookup怎么用?Java StrLookup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StrLookup类属于org.apache.logging.log4j.core.lookup包,在下文中一共展示了StrLookup类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isUsingGemFireDefaultConfig

import org.apache.logging.log4j.core.lookup.StrLookup; //导入依赖的package包/类
public static boolean isUsingGemFireDefaultConfig() {
  final Configuration config =
      ((org.apache.logging.log4j.core.Logger) LogManager.getLogger(ROOT_LOGGER_NAME,
          GemFireParameterizedMessageFactory.INSTANCE)).getContext().getConfiguration();

  final StrSubstitutor sub = config.getStrSubstitutor();
  final StrLookup resolver = sub.getVariableResolver();

  final String value = resolver.lookup(GEMFIRE_DEFAULT_PROPERTY);

  return "true".equals(value);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:13,代码来源:LogService.java

示例2: configureSubstitutor

import org.apache.logging.log4j.core.lookup.StrLookup; //导入依赖的package包/类
/**
 * Create the Properties component.
 * @param properties An array of Property elements.
 * @param config The Configuration.
 * @return An Interpolator that includes the configuration properties.
 */
@PluginFactory
public static StrLookup configureSubstitutor(@PluginElement("Properties") final Property[] properties,
                                             @PluginConfiguration final Configuration config) {
    if (properties == null) {
        return new Interpolator(null);
    }
    final Map<String, String> map = new HashMap<String, String>(config.getProperties());

    for (final Property prop : properties) {
        map.put(prop.getName(), prop.getValue());
    }

    return new Interpolator(new MapLookup(map));
}
 
开发者ID:OuZhencong,项目名称:log4j2,代码行数:21,代码来源:PropertiesPlugin.java

示例3: configureSubstitutor

import org.apache.logging.log4j.core.lookup.StrLookup; //导入依赖的package包/类
/**
 * Creates the Properties component.
 * @param properties An array of Property elements.
 * @param config The Configuration.
 * @return An Interpolator that includes the configuration properties.
 */
@PluginFactory
public static StrLookup configureSubstitutor(@PluginElement("Properties") final Property[] properties,
                                             @PluginConfiguration final Configuration config) {
    if (properties == null) {
        return new Interpolator(config.getProperties());
    }
    final Map<String, String> map = new HashMap<>(config.getProperties());

    for (final Property prop : properties) {
        map.put(prop.getName(), prop.getValue());
    }

    return new Interpolator(new MapLookup(map), config.getPluginPackages());
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:21,代码来源:PropertiesPlugin.java


注:本文中的org.apache.logging.log4j.core.lookup.StrLookup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。