Class SerializedLayout

  • All Implemented Interfaces:
    Layout<LogEvent>, Encoder<LogEvent>

    @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 is JsonLayout when configured with properties="true". Deprecated since 2.9.
    Formats a LogEvent in its Java serialized form.
    • Method Detail

      • toByteArray

        public byte[] toByteArray​(LogEvent event)
        Deprecated.
        Formats a LogEvent 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.
      • getContentType

        public String getContentType()
        Deprecated.
        SerializedLayout returns a binary stream.
        Returns:
        The content type.