Class SerializedLayout
- java.lang.Object
-
- org.apache.logging.log4j.core.layout.AbstractLayout<LogEvent>
-
- org.apache.logging.log4j.core.layout.SerializedLayout
-
@Deprecated @Plugin(name="SerializedLayout", category="Core", elementType="layout", printObject=true) public final class SerializedLayout extends AbstractLayout<LogEvent>
Deprecated.Java Serialization has inherent security weaknesses, see https://www.owasp.org/index.php/Deserialization_of_untrusted_data . Using this layout is no longer recommended. An alternative layout containing the same information isJsonLayout
when configured with properties="true". Deprecated since 2.9.Formats aLogEvent
in its Java serialized form.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
AbstractLayout.Builder<B extends AbstractLayout.Builder<B>>
-
-
Field Summary
-
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static SerializedLayout
createLayout()
Deprecated.String
getContentType()
Deprecated.SerializedLayout returns a binary stream.byte[]
getHeader()
Deprecated.Returns the header, if one is available.byte[]
toByteArray(LogEvent event)
Deprecated.Formats aLogEvent
as a serialized byte array of the LogEvent object.LogEvent
toSerializable(LogEvent event)
Deprecated.Returns the LogEvent.-
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
encode, getConfiguration, getContentFormat, getFooter, markEvent
-
-
-
-
Method Detail
-
toByteArray
public byte[] toByteArray(LogEvent event)
Deprecated.Formats aLogEvent
as a serialized byte array of the LogEvent object.- Parameters:
event
- The LogEvent.- Returns:
- the formatted LogEvent.
-
toSerializable
public LogEvent toSerializable(LogEvent event)
Deprecated.Returns the LogEvent.- Parameters:
event
- The Logging Event.- Returns:
- The LogEvent.
-
createLayout
@Deprecated @PluginFactory public static SerializedLayout createLayout()
Deprecated.Creates a SerializedLayout.- Returns:
- A SerializedLayout.
-
getHeader
public byte[] getHeader()
Deprecated.Description copied from class:AbstractLayout
Returns the header, if one is available.
-
getContentType
public String getContentType()
Deprecated.SerializedLayout returns a binary stream.- Returns:
- The content type.
-
-