@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, trimToMaxSizeencode, getConfiguration, getContentFormat, markEventpublic static final String DEFAULT_FONT_FAMILY
public String getTitle()
public boolean isLocationInfo()
public boolean requiresLocation()
requiresLocation in interface org.apache.logging.log4j.core.impl.LocationAwarerequiresLocation in class org.apache.logging.log4j.core.layout.AbstractStringLayoutpublic 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.AbstractStringLayoutpublic byte[] getHeader()
getHeader in interface org.apache.logging.log4j.core.Layout<String>getHeader in class org.apache.logging.log4j.core.layout.AbstractStringLayoutpublic byte[] getFooter()
getFooter in interface org.apache.logging.log4j.core.Layout<String>getFooter in class org.apache.logging.log4j.core.layout.AbstractStringLayoutpublic static CustomHTMLLayout createDefaultLayout()
@PluginBuilderFactory public static CustomHTMLLayout.Builder newBuilder()
Copyright © 2016–2025. All rights reserved.