org.apache.log4j

Class HTMLLayout

Implemented Interfaces:
OptionHandler

public class HTMLLayout
extends Layout

This layout outputs events in a HTML table.
Author:
Ceki Gülcü

Field Summary

protected int
BUF_SIZE
static String
LOCATION_INFO_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm.
protected int
MAX_CAPACITY
static String
TITLE_OPTION
A string constant used in naming the option for setting the the HTML document title.

Fields inherited from class org.apache.log4j.Layout

LINE_SEP, LINE_SEP_LEN

Method Summary

void
activateOptions()
No options to activate.
String
format(LoggingEvent event)
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.
boolean
getLocationInfo()
Returns the current value of the LocationInfo option.
String
getTitle()
Returns the current value of the Title option.
boolean
ignoresThrowable()
The HTML layout handles the throwable contained in logging events.
void
setLocationInfo(boolean flag)
The LocationInfo option takes a boolean value.
void
setTitle(String title)
The Title option takes a String value.

Methods inherited from class org.apache.log4j.Layout

format, getContentType, getFooter, getHeader, ignoresThrowable

Field Details

BUF_SIZE

protected final int BUF_SIZE

LOCATION_INFO_OPTION

public static final String LOCATION_INFO_OPTION

Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.

A string constant used in naming the option for setting the the location information flag. Current value of this string constant is LocationInfo.

Note that all option keys are case sensitive.


MAX_CAPACITY

protected final int MAX_CAPACITY

TITLE_OPTION

public static final String TITLE_OPTION
A string constant used in naming the option for setting the the HTML document title. Current value of this string constant is Title.

Method Details

activateOptions

public void activateOptions()
No options to activate.
Specified by:
activateOptions in interface OptionHandler

format

public String format(LoggingEvent event)
Overrides:
format in interface Layout

getContentType

public String getContentType()
Returns the content type output by this layout, i.e "text/html".
Overrides:
getContentType in interface Layout

getFooter

public String getFooter()
Returns the appropriate HTML footers.
Overrides:
getFooter in interface Layout

getHeader

public String getHeader()
Returns appropriate HTML headers.
Overrides:
getHeader in interface Layout

getLocationInfo

public boolean getLocationInfo()
Returns the current value of the LocationInfo option.

getTitle

public String getTitle()
Returns the current value of the Title option.

ignoresThrowable

public boolean ignoresThrowable()
The HTML layout handles the throwable contained in logging events. Hence, this method return false.
Overrides:
ignoresThrowable in interface Layout

setLocationInfo

public void setLocationInfo(boolean flag)

setTitle

public void setTitle(String title)
The Title option takes a String value. This option sets the document title of the generated HTML document.

Defaults to 'Log4J Log Messages'.


Copyright 2000-2005 Apache Software Foundation.