Package ca.phon.app.log
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 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
Fields inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZE
Fields inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
configuration, eventCount, footer, header, LOGGER
Fields inherited from interface org.apache.logging.log4j.core.Layout
ELEMENT_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns the appropriate HTML footers.byte[]
Returns appropriate HTML headers.getTitle()
For testing purposes.void
setFontName
(String fontName) void
setFontSize
(LogLayout.FontSize fontSize) void
toSerializable
(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, trimToMaxSize
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout
encode, getConfiguration, getContentFormat, markEvent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.logging.log4j.core.layout.Encoder
encode
Methods 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:
getHeader
in interfaceorg.apache.logging.log4j.core.Layout<String>
- Overrides:
getHeader
in classorg.apache.logging.log4j.core.layout.AbstractStringLayout
- Returns:
- The header as a byte array.
-