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); }
/** * 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)); }
/** * 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()); }