/** * Prints the given values a single record of delimiter separated values followed by the record separator. * * <p> * The values will be quoted if needed. Quotes and newLine characters will be escaped. This method adds the record * separator to the output after printing the record, so there is no need to call {@link #println()}. * </p> * * @param values * values to output. * @throws IOException * If an I/O error occurs */ public void printRecord(final Object... values) throws IOException { format.printRecord(out, values); newRecord = true; }
/** * Prints the given values a single record of delimiter separated values followed by the record separator. * * <p> * The values will be quoted if needed. Quotes and newLine characters will be escaped. This method adds the record * separator to the output after printing the record, so there is no need to call {@link #println()}. * </p> * * @param values * values to output. * @throws IOException * If an I/O error occurs */ public void printRecord(final Object... values) throws IOException { format.printRecord(out, values); newRecord = true; }
/** * Prints the given values a single record of delimiter separated values followed by the record separator. * * <p> * The values will be quoted if needed. Quotes and newLine characters will be escaped. This method adds the record * separator to the output after printing the record, so there is no need to call {@link #println()}. * </p> * * @param values * values to output. * @throws IOException * If an I/O error occurs */ public void printRecord(final Object... values) throws IOException { format.printRecord(out, values); newRecord = true; }
.withNullString("null") .withQuote('\"') .printRecord(stringWriter, headerOfData); sinkListener.publish(stringWriter.toString()); isAddHeader = false; .withNullString("null") .withQuote('\"') .printRecord(stringWriter, dataOfEvent); sinkListener.publish(stringWriter.toString()); stringWriter.getBuffer().setLength(0);
.withNullString("null") .withQuote('\"') .printRecord(stringWriter, headerOfData); sinkListener.publish(stringWriter.toString()); isAddHeader = false; .withQuote('\"') .withRecordSeparator(System.lineSeparator()) .printRecord(stringWriter, dataOfEvent); .withNullString("null") .withQuote('\"') .printRecord(stringWriter, dataOfEvent); sinkListener.publish(stringWriter.toString()); stringWriter.getBuffer().setLength(0); .withQuote('\"') .withRecordSeparator(System.lineSeparator()) .printRecord(stringWriter, dataOfEvent); .withNullString("null") .withQuote('\"') .printRecord(stringWriter, dataOfEvent); sinkListener.publish(stringWriter.toString()); stringWriter.getBuffer().setLength(0);
@Override public String toSerializable(final LogEvent event) { final Message message = event.getMessage(); final Object[] parameters = message.getParameters(); final StringBuilder buffer = getStringBuilder(); try { getFormat().printRecord(buffer, parameters); return buffer.toString(); } catch (final IOException e) { StatusLogger.getLogger().error(message, e); return getFormat().getCommentMarker() + " " + e; } }