Class LogLayout
java.lang.Object
org.apache.logging.log4j.core.layout.AbstractLayout<String>
org.apache.logging.log4j.core.layout.AbstractStringLayout
ca.phon.app.log.LogLayout
- All Implemented Interfaces:
org.apache.logging.log4j.core.impl.LocationAware,org.apache.logging.log4j.core.Layout<String>,org.apache.logging.log4j.core.layout.Encoder<org.apache.logging.log4j.core.LogEvent>,org.apache.logging.log4j.core.StringLayout
public class LogLayout
extends org.apache.logging.log4j.core.layout.AbstractStringLayout
Log4j2 layout for application log messages.
Code adapted from
HtmlLayout-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B extends org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B>>, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer2 -
Field Summary
FieldsFields inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZEFields inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
configuration, eventCount, footer, header, LOGGERFields inherited from interface org.apache.logging.log4j.core.Layout
ELEMENT_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the appropriate HTML footers.byte[]Returns appropriate HTML headers.getTitle()For testing purposes.voidsetFontName(String fontName) voidsetFontSize(LogLayout.FontSize fontSize) voidtoSerializable(org.apache.logging.log4j.core.LogEvent event) Formats as a String.Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
getBytes, getCharset, getContentType, getFooterSerializer, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSizeMethods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
encode, getConfiguration, getContentFormat, markEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.core.layout.Encoder
encodeMethods inherited from interface org.apache.logging.log4j.core.Layout
getContentFormat
-
Field Details
-
DEFAULT_FONT_FAMILY
Default font family: .
-
-
Constructor Details
-
LogLayout
public LogLayout() -
LogLayout
-
LogLayout
-
-
Method Details
-
getTitle
For testing purposes. -
setTitle
-
setFontSize
-
getFontSize
-
getHeaderSize
-
getFontName
-
setFontName
-
toSerializable
Formats as a String.- Parameters:
event- The Logging Event.- Returns:
- A String containing the LogEvent as HTML.
-
getHeader
public byte[] getHeader()Returns appropriate HTML headers.- Specified by:
getHeaderin interfaceorg.apache.logging.log4j.core.Layout<String>- Overrides:
getHeaderin classorg.apache.logging.log4j.core.layout.AbstractStringLayout- Returns:
- The header as a byte array.
-