Class CsvLogEventLayout
java.lang.Object
org.apache.logging.log4j.core.layout.AbstractLayout<String>
org.apache.logging.log4j.core.layout.AbstractStringLayout
org.apache.logging.log4j.core.layout.AbstractCsvLayout
org.apache.logging.log4j.core.layout.CsvLogEventLayout
- All Implemented Interfaces:
LocationAware, Layout<String>, Encoder<LogEvent>, StringLayout
@Plugin(name="CsvLogEventLayout",
category="Core",
elementType="layout",
printObject=true)
public class CsvLogEventLayout
extends AbstractCsvLayout
A Comma-Separated Value (CSV) layout to log events.
Depends on Apache Commons CSV 1.2.
- Since:
- 2.4
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractStringLayout
AbstractStringLayout.Builder<B>, AbstractStringLayout.Serializer, AbstractStringLayout.Serializer2 -
Field Summary
Fields inherited from class AbstractCsvLayout
DEFAULT_CHARSET, DEFAULT_FORMATFields inherited from class AbstractStringLayout
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZEFields inherited from class AbstractLayout
configuration, eventCount, footer, header, LOGGERFields inherited from interface Layout
ELEMENT_TYPE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCsvLogEventLayout(Configuration config, Charset charset, org.apache.commons.csv.CSVFormat csvFormat, String header, String footer) -
Method Summary
Modifier and TypeMethodDescriptionstatic CsvLogEventLayoutstatic CsvLogEventLayoutcreateLayout(org.apache.commons.csv.CSVFormat format) static CsvLogEventLayoutcreateLayout(Configuration config, String format, Character delimiter, Character escape, Character quote, org.apache.commons.csv.QuoteMode quoteMode, String nullString, String recordSeparator, Charset charset, String header, String footer) toSerializable(LogEvent event) Formats the event as an Object that can be serialized.Methods inherited from class AbstractCsvLayout
createFormat, getContentType, getFormatMethods inherited from class AbstractStringLayout
getBytes, getCharset, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSizeMethods inherited from class AbstractLayout
encode, getConfiguration, getContentFormat, markEventMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Layout
getContentFormat
-
Constructor Details
-
CsvLogEventLayout
protected CsvLogEventLayout(Configuration config, Charset charset, org.apache.commons.csv.CSVFormat csvFormat, String header, String footer)
-
-
Method Details
-
createDefaultLayout
-
createLayout
-
createLayout
@PluginFactory public static CsvLogEventLayout createLayout(@PluginConfiguration Configuration config, @PluginAttribute(value="format",defaultString="Default") String format, @PluginAttribute("delimiter") Character delimiter, @PluginAttribute("escape") Character escape, @PluginAttribute("quote") Character quote, @PluginAttribute("quoteMode") org.apache.commons.csv.QuoteMode quoteMode, @PluginAttribute("nullString") String nullString, @PluginAttribute("recordSeparator") String recordSeparator, @PluginAttribute(value="charset",defaultString="UTF-8") Charset charset, @PluginAttribute("header") String header, @PluginAttribute("footer") String footer) -
toSerializable
-