@PluginFactory
  public static StringAppender createStringAppender(
      @PluginAttribute("name") String nullablePatternString) {
    PatternLayout layout;
    if (nullablePatternString == null) {
      layout = PatternLayout.createDefaultLayout();
    } else {
      layout = PatternLayout.createLayout(nullablePatternString, null, configuration,
          null, null, true, false, null, null);
    }

    return new StringAppender(APPENDER_NAME, layout, null, false, true,
        new StringOutputStreamManager(new ByteArrayOutputStream(), "StringStream", layout));
  }
Instantiate a WriterAppender and set the output destination to a
new {@link OutputStreamWriter} initialized with <code>os</code>
as its {@link OutputStream}.

@param name             The name of the Appender.
@param layout           The layout to format the message.
@param filter
@param ignoreExceptions
@param immediateFlush
@param manager          The OutputStreamManager.
ql/src/test/org/apache/hadoop/hive/ql/metadata/StringAppender.java