/** * Copies overridable configurations from the pipeline configuration into the given {@link CConfiguration}. */ private CConfiguration setupPipelineCConf(JoranConfigurator configurator, CConfiguration cConf) { Context context = configurator.getContext(); // The list of properties that can be overridden per pipeline configuration Set<String> keys = ImmutableSet.of( Constants.Logging.PIPELINE_BUFFER_SIZE, Constants.Logging.PIPELINE_EVENT_DELAY_MS, Constants.Logging.PIPELINE_KAFKA_FETCH_SIZE, Constants.Logging.PIPELINE_CHECKPOINT_INTERVAL_MS, Constants.Logging.PIPELINE_LOGGER_CACHE_SIZE, Constants.Logging.PIPELINE_LOGGER_CACHE_EXPIRATION_MS ); // For each of the allowed key, try to resolves through the configurator execution context. // If in the logback xml has that <property>, the one form the execution context would have higher precedence // than the one in the context when the subst() is called. // We cannot put the properties in the context before calling doConfigure as logback won't pickup the one // defined in the logback xml. for (String key : keys) { context.putProperty(key, cConf.get(key)); cConf.set(key, configurator.getExecutionContext().subst("${" + key + "}")); } return cConf; } }
/** * Copies overridable configurations from the pipeline configuration into the given {@link CConfiguration}. */ private CConfiguration setupPipelineCConf(JoranConfigurator configurator, CConfiguration cConf) { Context context = configurator.getContext(); // The list of properties that can be overridden per pipeline configuration Set<String> keys = ImmutableSet.of( Constants.Logging.PIPELINE_BUFFER_SIZE, Constants.Logging.PIPELINE_EVENT_DELAY_MS, Constants.Logging.PIPELINE_KAFKA_FETCH_SIZE, Constants.Logging.PIPELINE_CHECKPOINT_INTERVAL_MS, Constants.Logging.PIPELINE_LOGGER_CACHE_SIZE, Constants.Logging.PIPELINE_LOGGER_CACHE_EXPIRATION_MS ); // For each of the allowed key, try to resolves through the configurator execution context. // If in the logback xml has that <property>, the one form the execution context would have higher precedence // than the one in the context when the subst() is called. // We cannot put the properties in the context before calling doConfigure as logback won't pickup the one // defined in the logback xml. for (String key : keys) { context.putProperty(key, cConf.get(key)); cConf.set(key, configurator.getExecutionContext().subst("${" + key + "}")); } return cConf; } }