ch.qos.logback.classic

## Class PatternLayout

- java.lang.Object
- - ch.qos.logback.core.spi.ContextAwareBase
  - - ch.qos.logback.core.LayoutBase<E>
    - - ch.qos.logback.core.pattern.PatternLayoutBase<ILoggingEvent>
      - - ch.qos.logback.classic.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 http://logback.qos.ch/manual/layouts.html#PatternLayout

### Field Summary

Fields
`static java.util.Map<java.lang.String,java.lang.String>` `defaultConverterMap`
`static java.lang.String` `HEADER_PREFIX`

### Fields inherited from class ch.qos.logback.core.pattern.PatternLayoutBase

`outputPatternAsHeader, postCompileProcessor`

### Fields inherited from class ch.qos.logback.core.LayoutBase

`started`

### Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

`context`

### Constructor Summary

Constructors
Constructor and Description
`PatternLayout()`

### Method Summary

Methods
`java.lang.String` `doLayout(ILoggingEvent event)` Transform an event (of type Object) and return it as a String after appropriate formatting.
`java.util.Map<java.lang.String,java.lang.String>` `getDefaultConverterMap()` Concrete implementations of this class are responsible for elaborating the mapping between pattern words and converters.
`protected java.lang.String` `getPresentationHeaderPrefix()`

### Methods inherited from class ch.qos.logback.core.pattern.PatternLayoutBase

`getEffectiveConverterMap, getInstanceConverterMap, getPattern, getPresentationHeader, isOutputPatternAsHeader, setContextForConverters, setOutputPatternAsHeader, setPattern, setPostCompileProcessor, start, toString, writeLoopOnConverters`

### Methods inherited from class ch.qos.logback.core.LayoutBase

`getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, stop`

### Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface ch.qos.logback.core.spi.ContextAware

`addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn`

### Field Detail

#### defaultConverterMap

    public static final java.util.Map<java.lang.String,java.lang.String> defaultConverterMap

#### HEADER_PREFIX

    public static final java.lang.String HEADER_PREFIX

See Also:
  Constant Field Values

### Constructor Detail

#### PatternLayout

    public PatternLayout()

### Method Detail

#### getDefaultConverterMap

    public java.util.Map<java.lang.String,java.lang.String> getDefaultConverterMap()

Description copied from class: `PatternLayoutBase`
Concrete implementations of this class are responsible for elaborating the mapping between pattern words and converters.

Specified by:
  `getDefaultConverterMap` in class `PatternLayoutBase<ILoggingEvent>`
Returns:
  A map associating pattern words to the names of converter classes

#### doLayout

    public java.lang.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.

Parameters:
  `event` - The event to format
Returns:
  the event formatted as a String

#### getPresentationHeaderPrefix

    protected java.lang.String getPresentationHeaderPrefix()

Overrides:
  `getPresentationHeaderPrefix` in class `PatternLayoutBase<ILoggingEvent>`