Class PatternLayout

  • All Implemented Interfaces:
    LocationAware, Layout<String>, Encoder<LogEvent>, StringLayout

    @Plugin(name="PatternLayout",
            category="Core",
            elementType="layout",
            printObject=true)
    public final class PatternLayout
    extends AbstractStringLayout
    A flexible layout configurable with pattern string.

    The goal of this class is to format a LogEvent and return the results. The format of the result depends on the conversion pattern.

    The conversion pattern is closely related to the conversion pattern of the printf function in C. A conversion pattern is composed of literal text and format control expressions called conversion specifiers.

    See the Log4j Manual for details on the supported pattern converters.

    • Field Detail

      • DEFAULT_CONVERSION_PATTERN

        public static final String DEFAULT_CONVERSION_PATTERN
        Default pattern string for log output. Currently set to the string "%m%n" which just prints the application supplied message.
        See Also:
        Constant Field Values
      • TTCC_CONVERSION_PATTERN

        public static final String TTCC_CONVERSION_PATTERN
        A conversion pattern equivalent to the TTCCLayout. Current value is %r [%t] %p %c %notEmpty{%x }- %m%n.
        See Also:
        Constant Field Values
      • SIMPLE_CONVERSION_PATTERN

        public static final String SIMPLE_CONVERSION_PATTERN
        A simple pattern. Current value is %d [%t] %p %c - %m%n.
        See Also:
        Constant Field Values