@Override
    public PropertiesConfiguration getConfiguration(final LoggerContext loggerContext, final ConfigurationSource source) {
        final Properties properties = new Properties();
        try (final InputStream configStream = source.getInputStream()) {
            properties.load(configStream);
        } catch (final IOException ioe) {
            throw new ConfigurationException("Unable to load " + source.toString(), ioe);
        }
        PropertiesConfiguration propertiesConfiguration = new PropertiesConfigurationBuilder()
                .setConfigurationSource(source)
                .setRootProperties(properties)
                .setLoggerContext(loggerContext)
                .build();

        if (System.getProperty(PIPELINE_SEPARATE_LOGS, "false").equals("false")) {
            // force init to avoid overwrite of appenders section
            propertiesConfiguration.initialize();
            propertiesConfiguration.removeAppender(PIPELINE_ROUTING_APPENDER_NAME);
        }

        return propertiesConfiguration;
    }
@Test
    public void testDisableAppenderPerPipelineIsCreatedAfterLogLine() {
        System.setProperty(LogstashConfigurationFactory.PIPELINE_SEPARATE_LOGS, Boolean.FALSE.toString());
        forceLog4JContextRefresh();

        Logger logger = LogManager.getLogger(LogstashConfigurationFactoryTest.class);

        ThreadContext.put("pipeline.id", "pipeline_1");
        logger.info("log for pipeline 1");

        ThreadContext.remove("pipeline_1");
        ThreadContext.put("pipeline.id", "pipeline_2");
        logger.info("log for pipeline 2");

        LoggerContext context = LoggerContext.getContext(false);
        final Configuration config = context.getConfiguration();
        RoutingAppender routingApp = config.getAppender(LogstashConfigurationFactory.PIPELINE_ROUTING_APPENDER_NAME);
        assertNull("No routing appender should be present", routingApp);
    }