Class LDHtmlLayout

java.lang.Object
org.apache.logging.log4j.core.layout.AbstractLayout<String>
org.apache.logging.log4j.core.layout.AbstractStringLayout
com.logicaldoc.util.log4j.LDHtmlLayout
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

@Plugin(name="LDHtmlLayout", category="Core", elementType="layout", printObject=true) public class LDHtmlLayout extends org.apache.logging.log4j.core.layout.AbstractStringLayout
Outputs events as rows in an HTML table on an HTML page.

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.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static enum 
    Possible font sizes

    Nested classes/interfaces inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout

    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: "arial,sans-serif".

    Fields inherited from interface org.apache.logging.log4j.core.Layout

    ELEMENT_TYPE
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates an HTML Layout using the default settings.
     
    byte[]
    Returns the appropriate HTML footers.
    byte[]
    Returns appropriate HTML headers.
     
    boolean
     
     
    boolean
     
    toSerializable(org.apache.logging.log4j.core.LogEvent event)
    Formats as a String.

    Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout

    getCharset, getFooterSerializer, getHeaderSerializer, toByteArray

    Methods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout

    encode, getConfiguration, getContentFormat

    Methods inherited from class java.lang.Object

    equals, 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: "arial,sans-serif".
      See Also:
  • Method Details

    • getTitle

      public String getTitle()
    • isLocationInfo

      public boolean isLocationInfo()
    • requiresLocation

      public boolean requiresLocation()
      Specified by:
      requiresLocation in interface org.apache.logging.log4j.core.impl.LocationAware
      Overrides:
      requiresLocation in class org.apache.logging.log4j.core.layout.AbstractStringLayout
    • 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.
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface org.apache.logging.log4j.core.Layout<String>
      Overrides:
      getContentType in class org.apache.logging.log4j.core.layout.AbstractStringLayout
    • 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.
    • createDefaultLayout

      public static LDHtmlLayout createDefaultLayout()
      Creates an HTML Layout using the default settings.
      Returns:
      an HTML Layout.
    • newBuilder

      @PluginBuilderFactory public static LDHtmlLayout.Builder newBuilder()