|
Log4j 1.0.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.log4j.Layout | +--org.apache.log4j.HTMLLayout
Field Summary | |
protected int |
BUF_SIZE
|
static String |
LOCATION_INFO_OPTION
A string constant used in naming the option for setting the the location information flag. |
protected int |
MAX_CAPACITY
|
Fields inherited from class org.apache.log4j.Layout |
LINE_SEP, LINE_SEP_LEN |
Constructor Summary | |
HTMLLayout()
|
Method Summary | |
void |
activateOptions()
Activate the options that were previously set with calls to setOption . |
String |
format(LoggingEvent event)
Implement this method to create your own layout format. |
String |
getContentType()
Returns the content type output by this layout, i.e "text/html". |
String |
getFooter()
Returns the appropriate HTML footers. |
String |
getHeader()
Returns appropriate HTML headers. |
String[] |
getOptionStrings()
Return list of strings that the OptionHandler instance recognizes. |
boolean |
ignoresThrowable()
If the layout handles the throwable object contained within LoggingEvent , then the layout should return
false . |
void |
setOption(String key,
String value)
Set HTMLLayout specific options. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final int BUF_SIZE
protected final int MAX_CAPACITY
public static final String LOCATION_INFO_OPTION
Note that all option keys are case sensitive.
Constructor Detail |
public HTMLLayout()
Method Detail |
public void activateOptions()
OptionHandler
setOption
.
This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.
For example, the FileAppender has the "File" and "Append" options both of which are ambigous until the other is also set.
public String format(LoggingEvent event)
Layout
format
in class Layout
public String getContentType()
getContentType
in class Layout
public String getHeader()
getHeader
in class Layout
public String getFooter()
getFooter
in class Layout
public String[] getOptionStrings()
OptionHandler
public boolean ignoresThrowable()
Layout
LoggingEvent
, then the layout should return
false
. Otherwise, if the layout ignores throwable
object, then the layout should return true
.
The SimpleLayout
, TTCCLayout
, PatternLayout
all return true
. The XMLLayout
returns false
.
ignoresThrowable
in class Layout
public void setOption(String key, String value)
The LocationInfo option takes a boolean value. By default, it is set to false which means there will be no location information output by this layoout. If the the option is set to true, then the file name and line number of the statement at the origin of the log statement will be output.
If you are embedding this layout within an SMTPAppender
then make sure to set the
LocationInfo option of that appender as well.
|
Log4j 1.0.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |