java.lang.Object |
↳ |
org.apache.log4j.Layout |
Known Direct Subclasses
DateLayout |
This abstract layout takes care of all the date related options and
formatting work. |
EnhancedPatternLayout |
This class is an enhanced version of org.apache.log4j.PatternLayout
which was originally developed as part of the abandoned log4j 1.3
effort and has been available in the extras companion. |
HTMLLayout |
This layout outputs events in a HTML table. |
PatternLayout |
A flexible layout configurable with pattern string. |
SimpleLayout |
SimpleLayout consists of the level of the log statement,
followed by " - " and then the log message itself. |
XMLLayout |
The output of the XMLLayout consists of a series of log4j:event
elements as defined in the log4j.dtd. |
|
Known Indirect Subclasses
TTCCLayout |
TTCC layout format consists of time, thread, category and nested
diagnostic context information, hence the name. |
|
Class Overview
Extend this abstract class to create your own log layout format.
Summary
Public Methods |
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 within
LoggingEvent , then the layout should return
false .
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.apache.log4j.spi.OptionHandler
abstract
void
|
activateOptions()
Activate the options that were previously set with calls to option
setters.
|
|
Fields
public
static
final
String
LINE_SEP
public
static
final
int
LINE_SEP_LEN
Public Constructors
Public Methods
public
abstract
String
format
(LoggingEvent event)
Implement this method to create your own layout format.
public
String
getContentType
()
Returns the content type output by this layout. The base class
returns "text/plain".
public
String
getFooter
()
Returns the footer for the layout format. The base class returns
null
.
public
String
getHeader
()
Returns the header for the layout format. The base class returns
null
.
public
abstract
boolean
ignoresThrowable
()
If the layout handles the throwable object contained within
LoggingEvent
, then the layout should return
false
. Otherwise, if the layout ignores throwable
object, then the layout should return true
.
If ignoresThrowable is true, the appender is responsible for
rendering the throwable.
The SimpleLayout
, TTCCLayout
, PatternLayout
all return true
. The XMLLayout
returns false
.