@Plugin(name="WHtmlLayout",
category="Core",
elementType="layout",
printObject=true)
public final class HtmlLayout
extends org.apache.logging.log4j.core.layout.AbstractStringLayout
| 限定符和类型 | 类和说明 |
|---|---|
static class |
HtmlLayout.Builder |
static class |
HtmlLayout.FontSize
Possible font sizes
|
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
DEFAULT_FONT_FAMILY
Default font family: "arial,sans-serif".
|
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZE| 限定符和类型 | 方法和说明 |
|---|---|
static HtmlLayout |
createDefaultLayout()
Creates an HTML Layout using the default settings.
|
static HtmlLayout |
createLayout(boolean locationInfo,
java.lang.String title,
java.lang.String contentType,
java.nio.charset.Charset charset,
java.lang.String fontSize,
java.lang.String font)
Create an HTML Layout.
|
java.lang.String |
getContentType() |
byte[] |
getFooter()
Returns the appropriate HTML footers.
|
byte[] |
getHeader()
Returns appropriate HTML headers.
|
static HtmlLayout.Builder |
newBuilder() |
java.lang.String |
toSerializable(org.apache.logging.log4j.core.LogEvent event)
Format as a String.
|
getBytes, getCharset, getFooterSerializer, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, serializeToBytes, serializeToString, toByteArray, trimToMaxSizeencode, getConfiguration, getContentFormat, markEvent, writeTopublic static final java.lang.String DEFAULT_FONT_FAMILY
public java.lang.String toSerializable(org.apache.logging.log4j.core.LogEvent event)
event - The Logging Event.public java.lang.String getContentType()
getContentType 在接口中 org.apache.logging.log4j.core.Layout<java.lang.String>getContentType 在类中 org.apache.logging.log4j.core.layout.AbstractStringLayoutpublic byte[] getHeader()
getHeader 在接口中 org.apache.logging.log4j.core.Layout<java.lang.String>getHeader 在类中 org.apache.logging.log4j.core.layout.AbstractStringLayoutpublic byte[] getFooter()
getFooter 在接口中 org.apache.logging.log4j.core.Layout<java.lang.String>getFooter 在类中 org.apache.logging.log4j.core.layout.AbstractStringLayout@PluginFactory public static HtmlLayout createLayout(@PluginAttribute(value="locationInfo") boolean locationInfo, @PluginAttribute(value="title",defaultString="Log4j Log Messages") java.lang.String title, @PluginAttribute(value="contentType") java.lang.String contentType, @PluginAttribute(value="charset",defaultString="UTF-8") java.nio.charset.Charset charset, @PluginAttribute(value="fontSize") java.lang.String fontSize, @PluginAttribute(value="fontName",defaultString="arial,sans-serif") java.lang.String font)
locationInfo - If "true", location information will be included. The default is false.title - The title to include in the file header. If none is specified the default title will be used.contentType - The content type. Defaults to "text/html".charset - The character set to use. If not specified, the default will be used.fontSize - The font size of the text.font - The font to use for the text.public static HtmlLayout createDefaultLayout()
@PluginBuilderFactory public static HtmlLayout.Builder newBuilder()