Package org.apache.log4j
Class Layout
- java.lang.Object
-
- org.apache.log4j.Layout
-
- Direct Known Subclasses:
LayoutWrapper
,PatternLayout
,SimpleLayout
public abstract class Layout extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LINE_SEP
static int
LINE_SEP_LEN
Note that the line.separator property can be looked up even by applets.
-
Constructor Summary
Constructors Constructor Description Layout()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.String
format(LoggingEvent event)
Implement this method to create your own layout format.java.lang.String
getContentType()
Returns the content type output by this layout.java.lang.String
getFooter()
Returns the footer for the layout format.java.lang.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
.
-
-
-
Method Detail
-
format
public abstract java.lang.String format(LoggingEvent event)
Implement this method to create your own layout format.- Parameters:
event
- The LoggingEvent.- Returns:
- The formatted LoggingEvent.
-
getContentType
public java.lang.String getContentType()
Returns the content type output by this layout. The base class returns "text/plain".- Returns:
- the type of content rendered by the Layout.
-
getHeader
public java.lang.String getHeader()
Returns the header for the layout format. The base class returnsnull
.- Returns:
- The header.
-
getFooter
public java.lang.String getFooter()
Returns the footer for the layout format. The base class returnsnull
.- Returns:
- The footer.
-
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 return
true
. The XMLLayout returnsfalse
.- Returns:
- true if the Layout ignores Throwables.
- Since:
- 0.8.4
-
-