Console Appender Definition

File log4j2 defines a Console appender, which is the root application console log definition. In the base configuration, the Console appender definition is similar to the following:

<Configuration>
  <Appenders>
    <Console name="Console" follow="true">
      <PatternLayout pattern="%-10.10X{server} %-8.24X{userID} 
            %d{yyyy-MM-dd HH:mm:ss,SSS} %p %notEmpty{&lt;%marker&gt; }%m%n" charset="UTF-8"/>
    </Console>
  </Appenders>
</Configuration>

Notice that the Console appender uses its own PatternLayout definition to format the output text. It does not use the default pattern that property file.defaultPattern defines.

See also