org.apache.logging.log4j.core.layout
Class SerializedLayout

java.lang.Object
  extended by org.apache.logging.log4j.core.layout.AbstractLayout<LogEvent>
      extended by org.apache.logging.log4j.core.layout.SerializedLayout
All Implemented Interfaces:
Layout<LogEvent>

public final class SerializedLayout
extends AbstractLayout<LogEvent>

Format a LogEvent in its serialized form.


Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
footer, LOGGER
 
Method Summary
static SerializedLayout createLayout()
          Create a SerializedLayout.
 byte[] getHeader()
          Returns the header, if one is available.
 byte[] toByteArray(LogEvent event)
          Formats a LogEvent in conformance with the log4j.dtd.
 LogEvent toSerializable(LogEvent event)
          Returns the LogEvent.
 
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
getFooter, setFooter, setHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toByteArray

public byte[] toByteArray(LogEvent event)
Formats a LogEvent in conformance with the log4j.dtd.

Parameters:
event - The LogEvent.
Returns:
the formatted LogEvent.

toSerializable

public LogEvent toSerializable(LogEvent event)
Returns the LogEvent.

Parameters:
event - The Logging Event.
Returns:
The LogEvent.

createLayout

public static SerializedLayout createLayout()
Create a SerializedLayout.

Returns:
A SerializedLayout.

getHeader

public byte[] getHeader()
Description copied from class: AbstractLayout
Returns the header, if one is available.

Specified by:
getHeader in interface Layout<LogEvent>
Overrides:
getHeader in class AbstractLayout<LogEvent>
Returns:
A byte array containing the header.


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved. Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, and the Apache Logging project logo are trademarks of The Apache Software Foundation.