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 class
static class
private static class
protected static class
Nested 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 boolean
protected static final String
protected final boolean
protected static final String
protected final String
protected final boolean
protected final com.fasterxml.jackson.databind.ObjectWriter
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
ConstructorsModifierConstructorDescriptionprotected
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) 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.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. -
Method Summary
Modifier and TypeMethodDescriptionprivate static LogEvent
private static AbstractJacksonLayout.ResolvableKeyValuePair[]
prepareAdditionalFields
(Configuration config, KeyValuePair[] additionalFields) resolveAdditionalFields
(LogEvent logEvent) toSerializable
(LogEvent event) Formats aLogEvent
.void
toSerializable
(LogEvent event, Writer writer) protected static boolean
valueNeedsLookup
(String value) protected Object
wrapLogEvent
(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, 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
-
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.JsonGenerationException
com.fasterxml.jackson.databind.JsonMappingException
IOException
-