Class AbstractCsvLayout
- java.lang.Object
-
- org.apache.logging.log4j.core.layout.AbstractLayout<java.lang.String>
-
- org.apache.logging.log4j.core.layout.AbstractStringLayout
-
- org.apache.logging.log4j.core.layout.AbstractCsvLayout
-
- All Implemented Interfaces:
Layout<java.lang.String>
,Encoder<LogEvent>
,StringLayout
- Direct Known Subclasses:
CsvLogEventLayout
,CsvParameterLayout
public abstract class AbstractCsvLayout extends AbstractStringLayout
A superclass for Comma-Separated Value (CSV) layouts. 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 Modifier and Type Field Description protected static java.lang.String
DEFAULT_CHARSET
protected static java.lang.String
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
Constructors Modifier Constructor Description protected
AbstractCsvLayout(Configuration config, java.nio.charset.Charset charset, org.apache.commons.csv.CSVFormat csvFormat, java.lang.String header, java.lang.String footer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static org.apache.commons.csv.CSVFormat
createFormat(java.lang.String format, java.lang.Character delimiter, java.lang.Character escape, java.lang.Character quote, org.apache.commons.csv.QuoteMode quoteMode, java.lang.String nullString, java.lang.String recordSeparator)
java.lang.String
getContentType()
Returns the content type output by this layout.org.apache.commons.csv.CSVFormat
getFormat()
-
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
getBytes, getCharset, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, 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, toSerializable
-
-
-
-
Field Detail
-
DEFAULT_CHARSET
protected static final java.lang.String DEFAULT_CHARSET
- See Also:
- Constant Field Values
-
DEFAULT_FORMAT
protected static final java.lang.String DEFAULT_FORMAT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractCsvLayout
protected AbstractCsvLayout(Configuration config, java.nio.charset.Charset charset, org.apache.commons.csv.CSVFormat csvFormat, java.lang.String header, java.lang.String footer)
-
-
Method Detail
-
createFormat
protected static org.apache.commons.csv.CSVFormat createFormat(java.lang.String format, java.lang.Character delimiter, java.lang.Character escape, java.lang.Character quote, org.apache.commons.csv.QuoteMode quoteMode, java.lang.String nullString, java.lang.String recordSeparator)
-
getContentType
public java.lang.String getContentType()
Description copied from interface:Layout
Returns the content type output by this layout. The base class returns "text/plain".- Specified by:
getContentType
in interfaceLayout<java.lang.String>
- Overrides:
getContentType
in classAbstractStringLayout
- Returns:
- The default content type for Strings.
-
getFormat
public org.apache.commons.csv.CSVFormat getFormat()
-
-