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
Extend this abstract class to create your own log layout format.
- Author:
- Ceki Gülcü
-
Field Summary
Fields -
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
.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 Details
-
LINE_SEP
-
LINE_SEP_LEN
public static final int LINE_SEP_LEN
-
-
Constructor Details
-
Layout
public Layout()
-
-
Method Details
-
format
Implement this method to create your own layout format. -
getContentType
Returns the content type output by this layout. The base class returns "text/plain". -
getHeader
Returns the header 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
-