org.apache.logging.log4j.core.layout
Class PatternLayout.Builder

java.lang.Object
  extended by org.apache.logging.log4j.core.layout.PatternLayout.Builder
All Implemented Interfaces:
Builder<PatternLayout>
Enclosing class:
PatternLayout

public static class PatternLayout.Builder
extends Object
implements Builder<PatternLayout>

Custom PatternLayout builder. Use the builder factory method to create this.


Method Summary
 PatternLayout build()
          Builds the plugin object after all configuration has been set.
 PatternLayout.Builder withAlwaysWriteExceptions(boolean alwaysWriteExceptions)
           
 PatternLayout.Builder withCharset(Charset charset)
           
 PatternLayout.Builder withConfiguration(Configuration configuration)
           
 PatternLayout.Builder withFooter(String footer)
           
 PatternLayout.Builder withHeader(String header)
           
 PatternLayout.Builder withNoConsoleNoAnsi(boolean noConsoleNoAnsi)
           
 PatternLayout.Builder withPattern(String pattern)
           
 PatternLayout.Builder withRegexReplacement(RegexReplacement regexReplacement)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

withPattern

public PatternLayout.Builder withPattern(String pattern)

withConfiguration

public PatternLayout.Builder withConfiguration(Configuration configuration)

withRegexReplacement

public PatternLayout.Builder withRegexReplacement(RegexReplacement regexReplacement)

withCharset

public PatternLayout.Builder withCharset(Charset charset)

withAlwaysWriteExceptions

public PatternLayout.Builder withAlwaysWriteExceptions(boolean alwaysWriteExceptions)

withNoConsoleNoAnsi

public PatternLayout.Builder withNoConsoleNoAnsi(boolean noConsoleNoAnsi)

withHeader

public PatternLayout.Builder withHeader(String header)

withFooter

public PatternLayout.Builder withFooter(String footer)

build

public PatternLayout build()
Description copied from interface: Builder
Builds the plugin object after all configuration has been set. This will use default values for any unspecified attributes for the plugin.

Specified by:
build in interface Builder<PatternLayout>
Returns:
the configured plugin instance.


Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.