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

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

public final class SerializedLayout
extends LayoutBase<LogEvent>

Format a LogEvent in its serialized form.


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

Method Detail

format

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

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

formatAs

public LogEvent formatAs(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: LayoutBase
Return the header, if one is available.

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


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.