Class Log4j2ConfluencePatternLayoutBuilder

  • All Implemented Interfaces:
    org.apache.log4j.builders.layout.LayoutBuilder

    @Plugin(name="com.atlassian.confluence.impl.logging.ConfluencePatternLayout",
            category="Log4j Builder")
    @PluginAliases("com.atlassian.logging.log4j.NewLineIndentingFilteringPatternLayout")
    public final class Log4j2ConfluencePatternLayoutBuilder
    extends org.apache.log4j.builders.AbstractBuilder
    A Log4j2.x Plugin that constructs a Log4j1.x Layout that emulates ConfluencePatternLayout as used under log4j1.x. This is for use by log4j2.x under its log4j1.x emulation mode. This class is based upon PatternLayoutBuilder, but adds the custom pattern converters used by ConfluencePatternLayout.
    Since:
    7.14
    • Field Summary

      • Fields inherited from class org.apache.log4j.builders.AbstractBuilder

        APPEND_PARAM, BUFFER_SIZE_PARAM, BUFFERED_IO_PARAM, FILE_PARAM, MAX_BACKUP_INDEX, MAX_SIZE_PARAM, RELATIVE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected String modifyPattern​(String pattern)
      Since this needs to work with log4j1.x-era configurations, we need to substitute the single-character pattern specifiers used by the log4j1.x ConfluencePatternLayout with the multi-character pattern specifiers used by log4j2.x
      org.apache.log4j.Layout parseLayout​(org.apache.log4j.config.PropertiesConfiguration config)  
      org.apache.log4j.Layout parseLayout​(Element element, org.apache.log4j.xml.XmlConfiguration config)  
      • Methods inherited from class org.apache.log4j.builders.AbstractBuilder

        buildFilters, getBooleanProperty, getIntegerProperty, getProperties, getProperty, getProperty
    • Constructor Detail

      • Log4j2ConfluencePatternLayoutBuilder

        public Log4j2ConfluencePatternLayoutBuilder​(String prefix,
                                                    Properties props)
    • Method Detail

      • modifyPattern

        protected String modifyPattern​(String pattern)
        Since this needs to work with log4j1.x-era configurations, we need to substitute the single-character pattern specifiers used by the log4j1.x ConfluencePatternLayout with the multi-character pattern specifiers used by log4j2.x
      • parseLayout

        public org.apache.log4j.Layout parseLayout​(org.apache.log4j.config.PropertiesConfiguration config)
        Specified by:
        parseLayout in interface org.apache.log4j.builders.layout.LayoutBuilder
      • parseLayout

        public org.apache.log4j.Layout parseLayout​(Element element,
                                                   org.apache.log4j.xml.XmlConfiguration config)
        Specified by:
        parseLayout in interface org.apache.log4j.builders.layout.LayoutBuilder