Class CsvParameterLayout
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.CsvParameterLayout
- All Implemented Interfaces:
LocationAware,Layout<String>,Encoder<LogEvent>,StringLayout
@Plugin(name="CsvParameterLayout",
category="Core",
elementType="layout",
printObject=true)
public class CsvParameterLayout
extends AbstractCsvLayout
A Comma-Separated Value (CSV) layout to log event parameters.
The event message is currently ignored.
Best used with:
logger.debug(new ObjectArrayMessage(1, 2, "Bob"));
- 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_FORMATFields inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZEFields inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
configuration, eventCount, footer, header, LOGGERFields inherited from interface org.apache.logging.log4j.core.Layout
ELEMENT_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionCsvParameterLayout(Configuration config, Charset charset, org.apache.commons.csv.CSVFormat csvFormat, String header, String footer) -
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractCsvLayoutstatic AbstractCsvLayoutcreateLayout(org.apache.commons.csv.CSVFormat format) static AbstractCsvLayoutcreateLayout(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, getFormatMethods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
getBytes, getCharset, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSizeMethods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
encode, getConfiguration, getContentFormat, markEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.core.Layout
getContentFormat
-
Constructor Details
-
CsvParameterLayout
public CsvParameterLayout(Configuration config, Charset charset, org.apache.commons.csv.CSVFormat csvFormat, String header, String footer)
-
-
Method Details
-
createDefaultLayout
-
createLayout
-
createLayout
@PluginFactory public static AbstractCsvLayout 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:LayoutFormats the event as an Object that can be serialized.- Parameters:
event- The Logging Event.- Returns:
- The formatted event.
-