Package org.apache.log4j
Class Layout
- java.lang.Object
-
- org.apache.log4j.Layout
-
- All Implemented Interfaces:
OptionHandler
- Direct Known Subclasses:
DateLayout
,EnhancedPatternLayout
,HTMLLayout
,PatternLayout
,SimpleLayout
,XMLLayout
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
Fields Modifier and Type Field Description static String
LINE_SEP
static int
LINE_SEP_LEN
-
Constructor Summary
Constructors Constructor Description Layout()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
format(LoggingEvent event)
Implement this method to create your own layout format.String
getContentType()
Returns the content type output by this layout.String
getFooter()
Returns the footer for the layout format.String
getHeader()
Returns the header for the layout format.abstract boolean
ignoresThrowable()
If the layout handles the throwable object contained withinLoggingEvent
, then the layout should returnfalse
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.log4j.spi.OptionHandler
activateOptions
-
-
-
-
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".
-
getHeader
public String getHeader()
Returns the header for the layout format. The base class returnsnull
.
-
getFooter
public String getFooter()
Returns the footer for the layout format. The base class returnsnull
.
-
ignoresThrowable
public abstract boolean ignoresThrowable()
If the layout handles the throwable object contained withinLoggingEvent
, then the layout should returnfalse
. Otherwise, if the layout ignores throwable object, then the layout should returntrue
. If ignoresThrowable is true, the appender is responsible for rendering the throwable.The
SimpleLayout
,TTCCLayout
,PatternLayout
all returntrue
. TheXMLLayout
returnsfalse
.- Since:
- 0.8.4
-
-