java.lang.Object
org.apache.log4j.Layout
- All Implemented Interfaces:
- org.apache.log4j.spi.OptionHandler
- Direct Known Subclasses:
- org.apache.log4j.helpers.DateLayout, HTMLLayout, PatternLayout, SimpleLayout
- public abstract class Layout
- extends java.lang.Object
- implements org.apache.log4j.spi.OptionHandler
Extend this abstract class to create your own log layout format.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LINE_SEP
public static final java.lang.String LINE_SEP
LINE_SEP_LEN
public static final int LINE_SEP_LEN
Layout
public Layout()
format
public abstract java.lang.String format(org.apache.log4j.spi.LoggingEvent event)
- Implement this method to create your own layout format.
getContentType
public java.lang.String getContentType()
- Returns the content type output by this layout. The base class
returns "text/plain".
getHeader
public java.lang.String getHeader()
- Returns the header for the layout format. The base class returns
null.
getFooter
public java.lang.String getFooter()
- Returns the footer for the layout format. The base class returns
null.
ignoresThrowable
public abstract boolean ignoresThrowable()
- If the layout handles the throwable object contained within
org.apache.log4j.spi.LoggingEvent, then the layout should return
false. Otherwise, if the layout ignores throwable
object, then the layout should return true.
The SimpleLayout, TTCCLayout, PatternLayout all return true. The org.apache.log4j.xml.XMLLayout returns false.
- Since:
- 0.8.4