String addAppender(final Writer writer) {
        final String name = "openfire-s2s-test-appender-" + StringUtils.randomString( 10 );
        final LoggerContext context = LoggerContext.getContext(false);
        final Configuration config = context.getConfiguration();
        final PatternLayout layout = PatternLayout.createDefaultLayout(config);
        final Appender appender = WriterAppender.createAppender(layout, null, writer, name, false, true);
        appender.start();
        config.addAppender(appender);

        final Level level = null;
        final Filter filter = null;
        for (final LoggerConfig loggerConfig : config.getLoggers().values()) {
            loggerConfig.addAppender(appender, level, filter);
        }
        config.getRootLogger().addAppender(appender, level, filter);
        return name;
    }
Run a test against the domain.
@return K-V pairs of debug information.
@throws Exception On error.
xmppserver/src/main/java/org/jivesoftware/util/S2STestService.java