@Plugin(name="CustomHTMLLayout",
category="Core",
elementType="layout",
printObject=true)
public final class CustomHTMLLayout
extends org.apache.logging.log4j.core.layout.AbstractStringLayout
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 | Class and Description |
---|---|
static class |
CustomHTMLLayout.Builder |
static class |
CustomHTMLLayout.FontSize
Possible font sizes
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FONT_FAMILY
Default font family: "arial,sans-serif".
|
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZE
Modifier and Type | Method and Description |
---|---|
static CustomHTMLLayout |
createDefaultLayout()
Creates an HTML Layout using the default settings.
|
String |
getContentType() |
byte[] |
getFooter()
Returns the appropriate HTML footers.
|
byte[] |
getHeader()
Returns appropriate HTML headers.
|
String |
getTitle()
For testing purposes.
|
boolean |
isLocationInfo()
For testing purposes.
|
static CustomHTMLLayout.Builder |
newBuilder() |
boolean |
requiresLocation() |
String |
toSerializable(org.apache.logging.log4j.core.LogEvent event)
Formats as a String.
|
getBytes, getCharset, getFooterSerializer, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, serializeToBytes, serializeToString, toByteArray, trimToMaxSize
encode, getConfiguration, getContentFormat, markEvent
public static final String DEFAULT_FONT_FAMILY
public String getTitle()
public boolean isLocationInfo()
public boolean requiresLocation()
requiresLocation
in interface org.apache.logging.log4j.core.impl.LocationAware
requiresLocation
in class org.apache.logging.log4j.core.layout.AbstractStringLayout
public String toSerializable(org.apache.logging.log4j.core.LogEvent event)
event
- The Logging Event.public String getContentType()
getContentType
in interface org.apache.logging.log4j.core.Layout<String>
getContentType
in class org.apache.logging.log4j.core.layout.AbstractStringLayout
public byte[] getHeader()
getHeader
in interface org.apache.logging.log4j.core.Layout<String>
getHeader
in class org.apache.logging.log4j.core.layout.AbstractStringLayout
public byte[] getFooter()
getFooter
in interface org.apache.logging.log4j.core.Layout<String>
getFooter
in class org.apache.logging.log4j.core.layout.AbstractStringLayout
public static CustomHTMLLayout createDefaultLayout()
@PluginBuilderFactory public static CustomHTMLLayout.Builder newBuilder()
Copyright © 2016–2021. All rights reserved.