Class PatternLayout

  • All Implemented Interfaces:
    Layout<ILoggingEvent>, ContextAware, LifeCycle

    public class PatternLayout
    extends PatternLayoutBase<ILoggingEvent>

    A flexible layout configurable with pattern string. The goal of this class is to format a ILoggingEvent and return the results in a {#link String}. The format of the result depends on the conversion pattern.

    For more information about this layout, please refer to the online manual at

    • Field Detail


        public static final Map<String,​String> DEFAULT_CONVERTER_MAP

        public static final Map<String,​String> CONVERTER_CLASS_TO_KEY_MAP
      • defaultConverterMap

        public static final Map<String,​String> defaultConverterMap
        replaced by DEFAULT_CONVERTER_MAP
    • Constructor Detail

      • PatternLayout

        public PatternLayout()
    • Method Detail

      • doLayout

        public String doLayout​(ILoggingEvent event)
        Description copied from interface: Layout
        Transform an event (of type Object) and return it as a String after appropriate formatting.

        Taking in an object and returning a String is the least sophisticated way of formatting events. However, it is remarkably CPU-effective.

        event - The event to format
        the event formatted as a String