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 org.apache.logging.log4j.core.layout.AbstractStringLayout
AbstractStringLayout.Builder<B extends AbstractStringLayout.Builder<B>>, AbstractStringLayout.Serializer, AbstractStringLayout.Serializer2
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.layout.AbstractCsvLayout
DEFAULT_CHARSET, DEFAULT_FORMAT
Fields inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZE
Fields inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
configuration, eventCount, footer, header, LOGGER
Fields inherited from interface org.apache.logging.log4j.core.Layout
ELEMENT_TYPE
-
Constructor Summary
ModifierConstructorDescriptionprotected
CsvLogEventLayout
(Configuration config, Charset charset, org.apache.commons.csv.CSVFormat csvFormat, String header, String footer) -
Method Summary
Modifier and TypeMethodDescriptionstatic CsvLogEventLayout
static CsvLogEventLayout
createLayout
(org.apache.commons.csv.CSVFormat format) static CsvLogEventLayout
createLayout
(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 org.apache.logging.log4j.core.layout.AbstractCsvLayout
createFormat, getContentType, getFormat
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
getBytes, getCharset, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSize
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
encode, getConfiguration, getContentFormat, markEvent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.logging.log4j.core.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
Description copied from interface:Layout
Formats the event as an Object that can be serialized.- Parameters:
event
- The Logging Event.- Returns:
- The formatted event.
-