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
    Modifier and Type
    Class
    Description
    static enum 
     

    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
    Modifier and Type
    Field
    Description
    static final String
    Default font family: .

    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

    Constructors
    Constructor
    Description
     
    LogLayout(String charset)
     
    LogLayout(Charset charset)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    byte[]
    Returns the appropriate HTML footers.
    byte[]
    Returns appropriate HTML headers.
     
    For testing purposes.
    void
    setFontName(String fontName)
     
    void
     
    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

      public static final String DEFAULT_FONT_FAMILY
      Default font family: .
  • Constructor Details

    • LogLayout

      public LogLayout()
    • LogLayout

      public LogLayout(String charset)
    • LogLayout

      public LogLayout(Charset charset)
  • Method Details

    • getTitle

      public String getTitle()
      For testing purposes.
    • setTitle

      public void setTitle(String title)
    • setFontSize

      public void setFontSize(LogLayout.FontSize fontSize)
    • getFontSize

      public LogLayout.FontSize getFontSize()
    • getHeaderSize

      public LogLayout.FontSize getHeaderSize()
    • getFontName

      public String getFontName()
    • setFontName

      public void setFontName(String fontName)
    • toSerializable

      public String toSerializable(org.apache.logging.log4j.core.LogEvent event)
      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 interface org.apache.logging.log4j.core.Layout<String>
      Overrides:
      getHeader in class org.apache.logging.log4j.core.layout.AbstractStringLayout
      Returns:
      The header as a byte array.
    • getFooter

      public byte[] getFooter()
      Returns the appropriate HTML footers.
      Specified by:
      getFooter in interface org.apache.logging.log4j.core.Layout<String>
      Overrides:
      getFooter in class org.apache.logging.log4j.core.layout.AbstractStringLayout
      Returns:
      the footer as a byte array.