Class DirectWriteRolloverStrategy.Builder
java.lang.Object
org.apache.logging.log4j.core.appender.rolling.DirectWriteRolloverStrategy.Builder
- All Implemented Interfaces:
Builder<DirectWriteRolloverStrategy>
- Enclosing class:
DirectWriteRolloverStrategy
public static class DirectWriteRolloverStrategy.Builder
extends Object
implements Builder<DirectWriteRolloverStrategy>
Builds DirectWriteRolloverStrategy instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Configurationprivate Action[]private Stringprivate booleanprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the object after all configuration has been set.Action[]booleanwithCompressionLevelStr(String compressionLevelStr) Defines compression level.withConfig(Configuration config) Defines configuration.withCustomActions(Action[] customActions) Defines custom actions.withMaxFiles(String maxFiles) Defines the maximum number of files to keep.withStopCustomActionsOnError(boolean stopCustomActionsOnError) Defines whether to stop executing asynchronous actions if an error occurs.withTempCompressedFilePattern(String tempCompressedFilePattern) Defines temporary compression file pattern.
-
Field Details
-
maxFiles
-
compressionLevelStr
-
customActions
-
stopCustomActionsOnError
-
tempCompressedFilePattern
-
config
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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<DirectWriteRolloverStrategy>- Returns:
- the configured instance.
-
getMaxFiles
-
withMaxFiles
Defines the maximum number of files to keep.- Parameters:
maxFiles- The maximum number of files that match the date portion of the pattern to keep.- Returns:
- This builder for chaining convenience
-
getCompressionLevelStr
-
withCompressionLevelStr
Defines compression level.- Parameters:
compressionLevelStr- The compression level, 0 (less) through 9 (more); applies only to ZIP files.- Returns:
- This builder for chaining convenience
-
getCustomActions
-
withCustomActions
Defines custom actions.- Parameters:
customActions- custom actions to perform asynchronously after rollover- Returns:
- This builder for chaining convenience
-
isStopCustomActionsOnError
public boolean isStopCustomActionsOnError() -
withStopCustomActionsOnError
public DirectWriteRolloverStrategy.Builder withStopCustomActionsOnError(boolean stopCustomActionsOnError) Defines whether to stop executing asynchronous actions if an error occurs.- Parameters:
stopCustomActionsOnError- whether to stop executing asynchronous actions if an error occurs- Returns:
- This builder for chaining convenience
-
getTempCompressedFilePattern
-
withTempCompressedFilePattern
public DirectWriteRolloverStrategy.Builder withTempCompressedFilePattern(String tempCompressedFilePattern) Defines temporary compression file pattern.- Parameters:
tempCompressedFilePattern- File pattern of the working file pattern used during compression, if null no temporary file are used- Returns:
- This builder for chaining convenience
-
getConfig
-
withConfig
Defines configuration.- Parameters:
config- The Configuration.- Returns:
- This builder for chaining convenience
-