org.apache.logging.log4j.core.layout
Class LayoutBase<T extends Serializable>

java.lang.Object
  extended by org.apache.logging.log4j.core.layout.LayoutBase<T>
Type Parameters:
T - The Class that the Layout will format the LogEvent into.
All Implemented Interfaces:
Layout<T>
Direct Known Subclasses:
AbstractStringLayout, SerializedLayout

public abstract class LayoutBase<T extends Serializable>
extends Object
implements Layout<T>

Base class for Layouts.


Field Summary
protected  byte[] footer
          The footer to add when the stream is closed.
protected  byte[] header
          The header to include when the stream is opened.
protected static Logger LOGGER
          Allow subclasses access to the status logger without creating another instance.
 
Constructor Summary
LayoutBase()
           
 
Method Summary
 byte[] getFooter()
          Returns the footer, if one is available.
 byte[] getHeader()
          Return the header, if one is available.
 void setFooter(byte[] footer)
          Set the footer.
 void setHeader(byte[] header)
          Set the header.
 
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
format, formatAs
 

Field Detail

LOGGER

protected static final Logger LOGGER
Allow subclasses access to the status logger without creating another instance.


header

protected byte[] header
The header to include when the stream is opened. May be null.


footer

protected byte[] footer
The footer to add when the stream is closed. May be null.

Constructor Detail

LayoutBase

public LayoutBase()
Method Detail

getHeader

public byte[] getHeader()
Return the header, if one is available.

Specified by:
getHeader in interface Layout<T extends Serializable>
Returns:
A byte array containing the header.

setHeader

public void setHeader(byte[] header)
Set the header.

Parameters:
header - The header.

getFooter

public byte[] getFooter()
Returns the footer, if one is available.

Specified by:
getFooter in interface Layout<T extends Serializable>
Returns:
A byte array containing the footer.

setFooter

public void setFooter(byte[] footer)
Set the footer.

Parameters:
footer - The footer.


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