Package org.apache.log4j
Class Layout
java.lang.Object
org.apache.log4j.Layout
- Direct Known Subclasses:
DateLayout
,LayoutWrapper
,PatternLayout
,SimpleLayout
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final int
Note that the line.separator property can be looked up even by applets. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String
format
(LoggingEvent event) Implement this method to create your own layout format.Returns the content type output by this layout.Returns the footer for the layout format.Returns the header for the layout format.abstract boolean
If the layout handles the throwable object contained withinLoggingEvent
, then the layout should returnfalse
.
-
Field Details
-
LINE_SEP
-
LINE_SEP_LEN
public static final int LINE_SEP_LENNote that the line.separator property can be looked up even by applets.
-
-
Constructor Details
-
Layout
public Layout()
-
-
Method Details
-
format
Implement this method to create your own layout format.- Parameters:
event
- The LoggingEvent.- Returns:
- The formatted LoggingEvent.
-
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
Returns the header for the layout format. The base class returnsnull
.- Returns:
- The header.
-
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
-