Class PatternLayout.Builder
java.lang.Object
org.apache.logging.log4j.core.layout.PatternLayout.Builder
- All Implemented Interfaces:
Builder<PatternLayout>
- Enclosing class:
- PatternLayout
Custom PatternLayout builder. Use the
builder factory method to create this.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the object after all configuration has been set.withAlwaysWriteExceptions(boolean alwaysWriteExceptions) withCharset(Charset charset) withConfiguration(Configuration configuration) withDisableAnsi(boolean disableAnsi) withFooter(String footer) withHeader(String header) withNoConsoleNoAnsi(boolean noConsoleNoAnsi) withPattern(String pattern) withPatternSelector(PatternSelector patternSelector) withRegexReplacement(RegexReplacement regexReplacement) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix, isValid
-
Method Details
-
withPattern
- Parameters:
pattern- The pattern. If not specified, defaults to DEFAULT_CONVERSION_PATTERN.
-
withPatternSelector
- Parameters:
patternSelector- Allows different patterns to be used based on some selection criteria.
-
withConfiguration
- Parameters:
configuration- The Configuration. Some Converters require access to the Interpolator.
-
withRegexReplacement
- Parameters:
regexReplacement- A Regex replacement
-
withCharset
- Parameters:
charset- The character set. The platform default is used if not specified.
-
withAlwaysWriteExceptions
- Parameters:
alwaysWriteExceptions- If"true"(default) exceptions are always written even if the pattern contains no exception tokens.
-
withDisableAnsi
- Parameters:
disableAnsi- Iftrue, do not output ANSI escape codes.
-
withNoConsoleNoAnsi
- Parameters:
noConsoleNoAnsi- If"true"(default is false) andSystem.console()is null, do not output ANSI escape codes
-
withHeader
- Parameters:
header- The header to place at the top of the document, once.
-
build
Description copied from interface:BuilderBuilds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
buildin interfaceBuilder<PatternLayout>- Returns:
- the configured instance.
-