public class HTMLLayout extends Layout
Appenders using this layout should have their encoding set to UTF-8 or UTF-16, otherwise events containing non ASCII characters could result in corrupted log files.
Modifier and Type | Field and Description |
---|---|
protected int |
BUF_SIZE |
static 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.
|
protected int |
MAX_CAPACITY |
static String |
TITLE_OPTION
A string constant used in naming the option for setting the the HTML document title.
|
LINE_SEP, LINE_SEP_LEN
Constructor and Description |
---|
HTMLLayout() |
Modifier and Type | Method and Description |
---|---|
void |
activateOptions()
No options to activate.
|
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.
|
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.
|
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.
public static final String TITLE_OPTION
public void setLocationInfo(boolean flag)
If you are embedding this layout within an SMTPAppender
then make sure to set the
LocationInfo option of that appender as well.
public boolean getLocationInfo()
public void setTitle(String title)
Defaults to 'Log4J Log Messages'.
public String getTitle()
public String getContentType()
getContentType
in class Layout
public void activateOptions()
public String format(LoggingEvent event)
Layout
public String getHeader()
public String getFooter()
public boolean ignoresThrowable()
false
.ignoresThrowable
in class Layout
Copyright © 1999–2024 QOS.CH Sarl (Switzerland). All rights reserved.