org.apache.log4j

Class Layout

public abstract class Layout extends Object implements OptionHandler

Extend this abstract class to create your own log layout format.

Author: Ceki Gülcü

Field Summary
static StringLINE_SEP
static intLINE_SEP_LEN
Method Summary
abstract Stringformat(LoggingEvent event)
Implement this method to create your own layout format.
StringgetContentType()
Returns the content type output by this layout.
StringgetFooter()
Returns the footer for the layout format.
StringgetHeader()
Returns the header for the layout format.
abstract booleanignoresThrowable()
If the layout handles the throwable object contained within {@link LoggingEvent}, then the layout should return false.

Field Detail

LINE_SEP

public static final String LINE_SEP

LINE_SEP_LEN

public static final int LINE_SEP_LEN

Method Detail

format

public abstract String format(LoggingEvent event)
Implement this method to create your own layout format.

getContentType

public String getContentType()
Returns the content type output by this layout. The base class returns "text/plain".

getFooter

public String getFooter()
Returns the footer for the layout format. The base class returns null.

getHeader

public String getHeader()
Returns the header for the layout format. The base class returns null.

ignoresThrowable

public abstract boolean ignoresThrowable()
If the layout handles the throwable object contained within {@link LoggingEvent}, then the layout should return false. Otherwise, if the layout ignores throwable object, then the layout should return true.

The {@link SimpleLayout}, {@link TTCCLayout}, {@link PatternLayout} all return true. The {@link org.apache.log4j.xml.XMLLayout} returns false.

Since: 0.8.4

Copyright 2000-2005 Apache Software Foundation.