Class AbstractJacksonLayout
java.lang.Object
org.apache.logging.log4j.core.layout.AbstractLayout<String>
org.apache.logging.log4j.core.layout.AbstractStringLayout
org.apache.logging.log4j.core.layout.AbstractJacksonLayout
- All Implemented Interfaces:
LocationAware,Layout<String>,Encoder<LogEvent>,StringLayout
- Direct Known Subclasses:
JsonLayout,XmlLayout,YamlLayout
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classprivate static classprotected static classNested classes/interfaces inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
AbstractStringLayout.Serializer, AbstractStringLayout.Serializer2 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AbstractJacksonLayout.ResolvableKeyValuePair[]protected final booleanprotected static final Stringprotected final booleanprotected static final Stringprotected final Stringprotected final booleanprotected final com.fasterxml.jackson.databind.ObjectWriterFields 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
ConstructorsModifierConstructorDescriptionprotectedAbstractJacksonLayout(Configuration config, com.fasterxml.jackson.databind.ObjectWriter objectWriter, Charset charset, boolean compact, boolean complete, boolean eventEol, String endOfLine, AbstractStringLayout.Serializer headerSerializer, AbstractStringLayout.Serializer footerSerializer, boolean includeNullDelimiter, KeyValuePair[] additionalFields) protectedAbstractJacksonLayout(Configuration config, com.fasterxml.jackson.databind.ObjectWriter objectWriter, Charset charset, boolean compact, boolean complete, boolean eventEol, AbstractStringLayout.Serializer headerSerializer, AbstractStringLayout.Serializer footerSerializer) Deprecated.protectedAbstractJacksonLayout(Configuration config, com.fasterxml.jackson.databind.ObjectWriter objectWriter, Charset charset, boolean compact, boolean complete, boolean eventEol, AbstractStringLayout.Serializer headerSerializer, AbstractStringLayout.Serializer footerSerializer, boolean includeNullDelimiter) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprivate static LogEventprivate static AbstractJacksonLayout.ResolvableKeyValuePair[]prepareAdditionalFields(Configuration config, KeyValuePair[] additionalFields) resolveAdditionalFields(LogEvent logEvent) toSerializable(LogEvent event) Formats aLogEvent.voidtoSerializable(LogEvent event, Writer writer) protected static booleanvalueNeedsLookup(String value) protected ObjectwrapLogEvent(LogEvent event) Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
getBytes, getCharset, getContentType, 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
-
Field Details
-
DEFAULT_EOL
- See Also:
-
COMPACT_EOL
- See Also:
-
eol
-
objectWriter
protected final com.fasterxml.jackson.databind.ObjectWriter objectWriter -
compact
protected final boolean compact -
complete
protected final boolean complete -
includeNullDelimiter
protected final boolean includeNullDelimiter -
additionalFields
-
-
Constructor Details
-
AbstractJacksonLayout
@Deprecated protected AbstractJacksonLayout(Configuration config, com.fasterxml.jackson.databind.ObjectWriter objectWriter, Charset charset, boolean compact, boolean complete, boolean eventEol, AbstractStringLayout.Serializer headerSerializer, AbstractStringLayout.Serializer footerSerializer) Deprecated. -
AbstractJacksonLayout
@Deprecated protected AbstractJacksonLayout(Configuration config, com.fasterxml.jackson.databind.ObjectWriter objectWriter, Charset charset, boolean compact, boolean complete, boolean eventEol, AbstractStringLayout.Serializer headerSerializer, AbstractStringLayout.Serializer footerSerializer, boolean includeNullDelimiter) Deprecated. -
AbstractJacksonLayout
protected AbstractJacksonLayout(Configuration config, com.fasterxml.jackson.databind.ObjectWriter objectWriter, Charset charset, boolean compact, boolean complete, boolean eventEol, String endOfLine, AbstractStringLayout.Serializer headerSerializer, AbstractStringLayout.Serializer footerSerializer, boolean includeNullDelimiter, KeyValuePair[] additionalFields)
-
-
Method Details
-
valueNeedsLookup
-
prepareAdditionalFields
private static AbstractJacksonLayout.ResolvableKeyValuePair[] prepareAdditionalFields(Configuration config, KeyValuePair[] additionalFields) -
toSerializable
Formats aLogEvent.- Parameters:
event- The LogEvent.- Returns:
- The XML representation of the LogEvent.
-
convertMutableToLog4jEvent
-
wrapLogEvent
-
resolveAdditionalFields
-
toSerializable
public void toSerializable(LogEvent event, Writer writer) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException - Throws:
com.fasterxml.jackson.core.JsonGenerationExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOException
-