Class RepositoryImportHTMLLayout

  • All Implemented Interfaces:
    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 RepositoryImportHTMLLayout
    extends Object
    implements org.apache.logging.log4j.core.StringLayout
    This class was derived from Log4j HTMLLayout. 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.
    Author:
    tkafalas
    • Constructor Detail

      • RepositoryImportHTMLLayout

        public RepositoryImportHTMLLayout​(org.apache.logging.log4j.Level loggerLogLevel)
    • Method Detail

      • setTitle

        public void setTitle​(String title)
        The Title option takes a String value. This option sets the document title of the generated HTML document.

        Defaults to 'Log4J Log Messages'.

      • getTitle

        public String getTitle()
        Returns the current value of the Title option.
      • getContentType

        public String getContentType()
        Returns the content type output by this layout, i.e "text/html".
        Specified by:
        getContentType in interface org.apache.logging.log4j.core.Layout<String>
      • getContentFormat

        public Map<String,​String> getContentFormat()
        Specified by:
        getContentFormat in interface org.apache.logging.log4j.core.Layout<String>
      • activateOptions

        public void activateOptions()
        No options to activate.
      • format

        public String format​(org.apache.logging.log4j.core.LogEvent event)
      • getHeader

        public byte[] getHeader()
        Returns appropriate HTML headers.
        Specified by:
        getHeader in interface org.apache.logging.log4j.core.Layout<String>
        Returns:
      • toByteArray

        public byte[] toByteArray​(org.apache.logging.log4j.core.LogEvent event)
        Specified by:
        toByteArray in interface org.apache.logging.log4j.core.Layout<String>
      • getFooter

        public byte[] getFooter()
        Returns the appropriate HTML footers.
        Specified by:
        getFooter in interface org.apache.logging.log4j.core.Layout<String>
        Returns:
      • ignoresThrowable

        public boolean ignoresThrowable()
        The HTML layout handles the throwable contained in logging events. Hence, this method return false.
      • toSerializable

        public String toSerializable​(org.apache.logging.log4j.core.LogEvent event)
        Specified by:
        toSerializable in interface org.apache.logging.log4j.core.Layout<String>
      • encode

        public void encode​(org.apache.logging.log4j.core.LogEvent source,
                           org.apache.logging.log4j.core.layout.ByteBufferDestination destination)
        Specified by:
        encode in interface org.apache.logging.log4j.core.layout.Encoder<org.apache.logging.log4j.core.LogEvent>
      • getCharset

        public Charset getCharset()
        Specified by:
        getCharset in interface org.apache.logging.log4j.core.StringLayout