Java 类org.apache.logging.log4j.core.util.StringBuilderWriter 实例源码

项目:logging-log4j2    文件:AbstractJacksonLayout.java   
/**
 * Formats a {@link org.apache.logging.log4j.core.LogEvent}.
 *
 * @param event The LogEvent.
 * @return The XML representation of the LogEvent.
 */
@Override
public String toSerializable(final LogEvent event) {
    final StringBuilderWriter writer = new StringBuilderWriter();
    try {
        toSerializable(event, writer);
        return writer.toString();
    } catch (final IOException e) {
        // Should this be an ISE or IAE?
        LOGGER.error(e);
        return Strings.EMPTY;
    }
}